MV stats changing mid-game using YEP equip core?

i want to find a way to make stats change mid-game by altering variables. i know that using equip core can let you use javascript code as custom parameters in the armor notetags but i think i'm encountering some problems with my code. keep in mind i don't know much javascript and i'm just going off of what little knowlegde i do have.


<Code Parameters>
if $gameVariables.value(1) == 2;
atk = $gamevariables.value(2);
</Code Parameters>

basically, i just want it to be like:
if variable 1 is equal to 2,
the armor's attack stat will be equal to the value of variable 2

if it's not possible to do this using equip core, is there another way i can change equipment stats mid-game? thanks a lot!!!
Maybe this?

<Code Parameters> if ($gameVariables.value(1) === 2) { atk = $gameVariables.value(2); } </Code Parameters>
Your notetag is incorrect - there's no such thing as "Code Parameters" in the instructions, it's Custom Parameters.

You also have inconsistent/incorrect capitalization in your code. It's $gameVariables, $gamevariables will not work.

Finally, you must have parentheses around a conditional, and cannot have a semicolon there. So your notetag would correctly read:
Code:
<Custom Parameters>
if ($gameVariables.value(1) == 2)
    atk = $gameVariables.value(2);
</Custom Parameters>
Your notetag is incorrect - there's no such thing as "Code Parameters" in the instructions, it's Custom Parameters.

You also have inconsistent/incorrect capitalization in your code. It's $gameVariables, $gamevariables will not work.

Finally, you must have parentheses around a conditional, and cannot have a semicolon there. So your notetag would correctly read:
Code:
<Custom Parameters>
if ($gameVariables.value(1) == 2)
    atk = $gameVariables.value(2);
</Custom Parameters>
thank you so much!!! i intend to learn more js at some point so your advice has helped a lot, it all works perfectly!!

Original thread: https://forums.rpgmakerweb.com/threads/stats-changing-mid-game-using-yep-equip-core.160081/