MV State that adds value dependent on Caster's Level

I want to add DEF to the target through a state. I want that value to be 3 * user.level

Using http://www.yanfly.moe/wiki/Buffs_&_States_Core_(YEP) , I tried:

<Custom Apply Effect>
target.gainDef(3 * user.level);
</Custom Apply Effect>

Can anyone tell me how to accomplish this?

Thank you in advance 🙂

I've moved this thread to Javascript/Plugin Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/state-that-adds-value-dependent-on-casters-level.130365/