States in damage formula

Hi. I've recently started messing with the damage formula. What I'm trying to do is trying to make a skill that is togglable on/off; It would both add a state to the user that would remove mana every turn, but also add a state to enemies that would deal damage every turn.

This is my current formula (with only the first state applied, damage will come later as I figure the first part)

if a.state?(68);a.remove_state(68);else:a.add_state(68);end

Which may be worded wrong. Any advice on that one?
I can't see anything wrong with toggling a state on the user. You can control a switch to make the effect togglable for the enemy as well. For damage over time and mana damage on the user, I think you should use Yanfy Lunatic States script.
I actually asked my question wrong. I tried with this fromula, but it doesn't seem to work. I believe there may be a mistake in there, can't find it though.

I will look up the scripts though, ty.
What did you expect to happen, and what really happened?
I expected that if state 68 on casting actor is active, upon using the skill, remove state 68.

If state 68 is not active on casting actor, add the state.

Nothing happened.
After the else you have : instead of ;
After the else you have : instead of ;
Yeeeeeeeep. You did it. I feel stupid.

Thanks for lending me your eyes 😀
Haha ...well : and ; are very similar , it is difficult to see it ...
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/states-in-damage-formula.40785/