Problem with self-states in damage formula

So I'm trying to make a skill which does two things

1. Deal damage to all enemies
2. Inflict a state on the caster

After searching a few threads I used "a.add_state(1);a.mhp*0.25" which is intended to deal 1/4 of the caster's max HP to all enemies and then kill the caster (similar to a self-destruct mechanism). However, the animation plays and then I get the error "require(...).Window.get(...).isDevToolsOpen is not a function"...

Does anyone have any idea what is triggering the error and/or a solution to my damage formula problem?
try using "a.setHp(0); a.mhp*0.25" instead of "a.add_state(1);"
try using "a.setHp(0); a.mhp*0.25" instead of "a.add_state(1);"

Yes! This works, the only problem is that after the skill is used the caster is treated as dead but the sprite remains on the field... Is there a way to force the collapse animation?

I mainly asked because there's another skill I'm working on which has the same concept but inflicts a state on the caster which weakens them for a few rounds instead of outright killing them. Is there a work-around for this?

Thanks heaps
Is there a way to force the collapse animation?

Try using "a.setHp(0); a.performCollapse(); a.mhp*0.25"
Tested it. It should work.
Just for future reference, it's a.addState(n); not a.add_state(n);

That said, yeah a.setHp(0); should be fine in this case, but if you want to add other states, add_state isn't a proper function.
Just for future reference, it's a.addState(n); not a.add_state(n);

That said, yeah a.setHp(0); should be fine in this case, but if you want to add other states, add_state isn't a proper function.

Perfect! Thanks heaps 🙂

Try using "a.setHp(0); a.performCollapse(); a.mhp*0.25"
Tested it. It should work.

Awesome, that all works fine thanks!

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-self-states-in-damage-formula.102170/