MV Tie Evasion Rate to Agility?

First - thank you for anyone who takes the time to help me with this.

I would like for the Agility parameter in my game to increase the Evasion Rate x-parameter. So for every 1 point increase in AGI, your Evasion Rate goes up 1% (for example).

I have many Yanfly plugins installed including AutoPassiveStates and BuffStatesCore.

If I understand correctly, I should be able to create a state with a <Custom Apply Effect> note tag so that when the Actor has that state, their Evasion Rate is increased by their AGI score. This is the note tag I am attempting to use which does not work-

<Custom Apply Effect>
console.log("Boo!");
target.addTrait("xparam", 1, target.agi / 100);
console.log("New Evasion Rate:", target.xparam(1));
</Custom Apply Effect>

(includes console commands to check that the state is being applied).

I have tried adding a Trait that increases Evasion Rate, this works and the new evasion rate is displayed in the console as well as in the game. However, nothing I modify with <Custom Apply Effect> notetags seems to be working.

Does anyone know if this is possible? Can you suggest a <Custom Apply Effect> note tag that would accomplish this? Or is there another means of accomplishing this?

Thank you again for any help!
This thread was moved from JS Plugin Releases (RMMV) to JavaScript/Plugin Support.

Original thread: https://forums.rpgmakerweb.com/threads/tie-evasion-rate-to-agility.175239/