Help with Action Sequences Skills(Trying to make Undying/Immortal Skill)

So, Hi. I'm making an Undying skill which is when the user use it. Then its health will be drain up to 99%.(One of bad effect of this skill). But, he will be able to stand/fight for about 5turns and the user is unkillable or unable to be kill because he still has the effect of 'Undying'/Immortal. it's because he has a Knockback resist or Immortal State. And while he is in Undying or Immortal state. He has a reduce amount of attack(physical). and Magic attack for about 50% (So its attack and magic attack will be reduce of 50% of it's current or maximum attack and magic attack.) So he has only 50% because the other 50% was also already consumed or lost.
If possible, I also want that while in Undying/Immortal Skill, He is unable to be healed by himself or by its teammates
And after the 5 turns. The user will be automatically die.

And also, If possible. Can you also please add some action sequence style? Like the movements, stances, and the most important is the animation. the animation when the skill will be cast and the exit animation when the user die or the undying is over.

So. I'm here to ask for your help. Can someone help me to make that skill? I really wanted to make that skill. I'm hoping for your kind helpness 🙂 More power! Thanks 🙂
The first part can be done with the default engine. Make the skill do b.hp * 0.99 in damage to the user, and add a state which makes them immune to state 1 (the death state in the engine) and ATK * 0.5 and MAT * 0.5. Set Recovery rate to 0% in the state as well, which should stop healing from working (though it might not if you set a heal spell in the damage formula, may have to investigate that more).

The automatic death when the state leaves requires a plug-in which will let a state do something when it is removed by the engine. No idea what is a good one for that so someone else will have to finish this off.
The first part can be done with the default engine. Make the skill do b.hp * 0.99 in damage to the user, and add a state which makes them immune to state 1 (the death state in the engine) and ATK * 0.5 and MAT * 0.5. Set Recovery rate to 0% in the state as well, which should stop healing from working (though it might not if you set a heal spell in the damage formula, may have to investigate that more).

The automatic death when the state leaves requires a plug-in which will let a state do something when it is removed by the engine. No idea what is a good one for that so someone else will have to finish this off.
So how about the turns? like the undying will last only for 5 turns. and the user will die automatically.
Also, to reduce the attack and magic attack of the user while using undying. Is setting a param to the states and set atk and mat to * 50%?
Yes. That's what the params mean in states. For 5 turns, set the state to last only 5 turns (put 5 for the min and max) in the state page of the database.

The dying automatically when removed will again require a plug-in, and I'm not sure which one or how to set that up, so that will take another person to help with that. But hopefully this will get you started!
For the "death on state removal" thing you could use Yanfly's Buffs & States Core plugin. Among other things, it provides a <Custom Remove Effect> notetag to specify a chunk of code that runs when the state is removed. State #1 is the death state; this seems to work for me:
Code:
<Custom Remove Effect>
user.addState(1);
</Custom Remove Effect>

Original thread: https://forums.rpgmakerweb.com/threads/help-with-action-sequences-skills-trying-to-make-undying-immortal-skill.93920/