Adressing Quick Controls

Also if you don’t mind can you help me address effects? I tried to use the manual but failed. I’m trying to tie two effect parameters (from different effects) to the same parameter. I feel like I have the right idea but the issue has to do with the position of the parameter definition or function line.

bus = this.parent:getBus("Internal FX")
if bus then
    --locate the distortion effect of the bus
    effect1 = bus:getEffect("Overdrive")
    effect2 = bus:getEffect("Distortion")
    if effect then
        function onDistortionMixChange()
            effect2:setParameter(13, DistortionMix)
            effect1:setParameter(0, DistortionMix)
        end
        defineParameter("DistortionMix", "DistortionMix", 50, 0, 100, 1, onDistortionMixChange)
    end
end