Attack that adds state on user instead of the enemy

So i wanted to do a attack that adds a state to the user instead of the target i looked it up and found out the way to do it is with a.add_state(stateid);attack formula


however when i do it it doesn't work instead the damage becomes null and the user doesn't get the state on them, i'd assume i did something wrong?


the way i did it is like this:


a.add_state009; a.atk * 4 - b.def * 2
You need the parenthesis around the number of the state, and don't need the zeroes. So you would use, for example:

Code:
a.add_state(9); a.atk * 4 - b.def * 2
Where's your ()? It should go:


a.addstate(9); your damage formula here.
oh whoops, didnt think they meant to actually use the () in that post my bad, can close this now

Original thread: https://forums.rpgmakerweb.com/threads/attack-that-adds-state-on-user-instead-of-the-enemy.63499/