Script to apply "Atk state" after damage has already been taken?

I set a few mobs to have an "Atk State" that has a 5% chance of applying the "shrunken" status effect. Shrunken is like Mini in FF but on steroids as it lowers stats to 1% of their max. This includes HP, MP, ATK, MAT, DEF, MDF, and LUK.

I was hoping that if the attack would apply the state, it would deal damage and then apply the status effect. However, I learned the hard way that the status effect is applied before the damage is dealt. This means it instantly kills the character.

I wanted the attack to apply the shrunken status effect but not kill the character. I have mobs that have battle events that tell the monster to eat a character that has this status effect, which applies an untargetable state and the character takes damage over time until the enemy is defeated or the character dies.

So, I cannot have characters dying from the attack that applies the shrunken status effect.

Sure, I can just dedicate a move that shrinks party members and I have those but I want to be able to control the percentages more. Since priority can only be in a range of three and I can make state on attack 5%, I want this option.

Is there a script that makes the state apply after the damage has been taken or could someone make one?

I would prefer to control this with something in a note box, but I am fine with a script that is all rounder. I do not have very many attack state enemies. I have a few weapons that poison enemies but that won't affect things if it is applied after the damage.


If I could get a script like this, I would appreciate it. Please and Thank You.


Edit: Apparently it was a script that was causing the death. I already posted in that script's topic informing the creator of the bug.
This thread is being closed at OP’s request. If you do find yourself needing it later, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/script-to-apply-atk-state-after-damage-has-already-been-taken.161683/