You can do this easily enough in the damage formula. You can add this after the damage output: ;a.add_state(State ID). This will add the state to the user after the damage is done. If you want to inflict a state on the target it's: ;b.add_state(State ID).
I tried adding:
100 + a.mat * 2 - b.mdf * 2 ; a.add_state(7)
But the result was that I now do 0 damage, and no state is added at all.
the damage formula must always return a number, so the calculations must be the last part of your code.
a.addState(7) ; 100 + a.mat * 2 - b.mdf * 2
should work ("add_state" is from RM VXa, the correct syntax on MV is "addState")
Thanks. It must indeed be added to the first part.
It seems the state worked. It's just not visible on the GUI because it has no state-icon so I thought it didn't work, but it did.