MV Changing skill animation based on a variable

Newbie here struggling to use Yanfly's battle plugins, I want skills to check for a variable and play (or not) a different animation depending on the result.

I tried putting this on the skill notetag for it to do the special animation if the variable is over 6:

<beforeEval>
if ($gameVariables.value(1) > 6) {
user._animationId = 9;
} else {
user._animationId = 1; }
</beforeEval>

I'm not sure if it works like this though, and the animation remains unchanged.😢please help.
I don't think that'll work with the order of animation playing. You may have to use an action sequence for this, which gives you finer control over what animations play when.
Oh, that was it. I got it to work like this:

<setup action>
display action
</setup action>

<target action>

if ($gameVariables.value(1)>6)
animation 9: target
wait for animation
action effect
else
animation 1: target
wait for animation
action effect
</target action>

Thanks for the advice!
Note your syntax is incomplete - it might not matter in this case, because it's the end of the action sequence, but it's expecting an end

Code:
if
    stuff
end

or
Code:
if
    stuff
else
    other stuff
end
Note your syntax is incomplete - it might not matter in this case, because it's the end of the action sequence, but it's expending an end
Thanks for that ~ yes it worked without the "end", but I know having good coding practice will come handy later.

Original thread: https://forums.rpgmakerweb.com/threads/changing-skill-animation-based-on-a-variable.164929/