Modify AI perception sense range during runtime

I have been looking around quite a lot to try and find an answer to this question, but as I am fairly new to using UE4 and still not great at c++ I was hoping someone could point me in the right direction.

What I want to be able to do is to modify the range of senses during runtime for my AI. This is to be able to make the range smaller if the AI is chasing after a sound or to make the sight radius bigger if the player is using a flashlight.

After finding this link and messing around in the BP editor I assume that the functionality was never added to blueprints, and as such I need to be able to do it using c++, but I am not sure how to use the provided code to expose the sense range to the BP editor.

Thanks in advance for any help.

Bump, still struggling with this.