There's a really simple way of doing this using a variable.
All you do is create a variable, so let's say var(39) and set it up so that it activates the variable when you are in palette 9
In your -2 state write
[state -2 varset bullshit]
type = varset
trigger1 = palno = 9
v = 39
value = 1
Now that you have that, go to your attack states in the -1 (command) and add this
triggerall = var(39) = 1
Make sure that when you code AI it ALSO has that too so the AI doesn't abuse anything it shouldn't have.