'Doomed' state

I wanna make a state in my game that will instantly kill the party member afflicted with it if they have it at the end of an encounter (that we'll just call 'doomed'), can i get any help on how i could make this?
mark the state as not removable after the end of battle, and you might require a bit of scripting to hook up to either the function handling the very end of battle (where drops are calculated) or the transfer back to the map scene.

to start with, make a common event that would look for that state and kill the affected actor, and run it after each battle.
if you have a lot of battles to process, you might want to turn to scripting, to automate it... but if not, you can call it manually every time.
You have two choices, either run your casualty processing event after every combat, or call your casualty processing event from a parallel process. Running the event after every combat ignores other causes of death, if you have them. Calling casualty processing from a parallel event might give a few seconds where the actor is "Doomed" before they actually die.

There are plugins that will run a common event after every combat. I use "Arty_PostBattleCommonEvent" in my current project to run an event that gives a small number of experience to the whole party, including non-battle party members. (The idea is that the battle party gains lots of experience combat but other members gain a little bit.)

With my current and recent projects, I renamed the knock-out state to "Dying". I use Himework's Party Manager have a "dead" party to store party members that have been killed or who have died outside combat. A common event processes dying members by removing them from the main party, putting them in the "dead" party, and reviving them ready for bringing back to life if the party, for instance, visits the necromancer.

My casualty processing event uses a little bit of scripting. A Conditional Branch uses "$gameParty.members()[$gameVariables.value(21)].states().contains($dataStates[1])" to check whether the party member whose index is the same as the value in variable 21 has state 1. A Control Variables uses "$gameParty.members()[$gameVariables.value(21)].actorId()" to put the actor ID of the actor into another variable.

I don't like too many parallel processes working at the same time so the casualty processing event is called from the main "Time" common event, every 20 frames on the world map, every 160 frames elsewhere.
Yanfly's buff & states core should be able to do this with a custom victory / escape / defeat effect and user.addState(1)

Original thread: https://forums.rpgmakerweb.com/threads/doomed-state.159547/