Range parameter for gate

Hi all

Can someone help me with adding a range parameters on a juce standard gate. I have created a setRange function and the variable that stores the range.

I then modified the update function and added the range as below

threshold = Decibels:: decibelsToGain (thresholddB, static_cast<float> (-200.0) * range);

But this doesn’t work as expected, when the range is 0 dB no gate is applied which is good but as the range gets greater than 0 Heavy gain reduction is applied the range doesn’t set the amount of gain reduction as I want it to. I hope this explanation makes sense.