MV yanfly, adding elements to attack skills.

Hey all,
I feel this should be a simple thing, but it's not working for me. Using Yanfly's element core and action sequence...
I'm trying to add to the skills' element depending on a preset variable.

<setup action>
if ($gameVariables.value(21) = 1) {
add element: 2;
}
</setup action>

Where have I messed up? A simple syntax problem? should I be using before eval? I'll be adding 5 more elements once I get this one working. Thanks for any input.
A simple syntax problem
action sequence notetags dont accept direct js like youre trying to use. its basically its own little scripting language and some portions may or may not use single lines of js. look at the example usage for everything youre using in your AS. braces arent used to create blocks for conditional statements and they have to end with the end keyword iirc
The action sequence has its own IF-ELSE statement. Use that instead.
Code:
IF $gameVariables.value(21) === 1
add element: 2
END
The action sequence has its own IF-ELSE statement. Use that instead.
Code:
IF $gameVariables.value(21) === 1
add element: 2
END
Yup that's got it. Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-adding-elements-to-attack-skills.180109/