"Death's Door" Mechanic Possible?

Hey there! I have a couple questions about a potential "Death's Door" mechanic inspired by Darkest Dungeon and I was wondering if anyone would be able to help me out.

The mechanic I'm thinking of goes like this:
- When you lose all of your HP or MP (MP being reduced by psychic damage), you gain a condition called "Vulnerable".
- While Vulnerable you can act normally.
- If you take any damage while Vulnerable, you die for real and cannot be revived (removed from party for companions, game over for main character).

Does anyone know if this is possible, and if so how? I'm open to using VisuStella or other plugins if it helps.

Thanks!
I like the idea of the mechanic. Firstly, I don't know how to do this but I have some suggestions that might point you in the right direction or at least get the conversation going.

For applying the Vulnerable state:
Without a plugin I think you'd need to make a variable that tracks all your actors HP and MP (one for each actor), then run a battle wide event which checks on this variable (again, for every actor). If the variable equals zero then the state is applied to the actor belonging to that variable.

Oh, and check out the Skills and States Core from VisuStella if you haven't already and read through all the functions. It might have what you need, or at least part of it.
Maybe it's what you'r looking for.
Oh, and check out the Skills and States Core from VisuStella if you haven't already and read through all the functions. It might have what you need, or at least part of it.
Definitely - Battle Core, actually. There's no fancy stuff necessary with the states, just need the ability to execute code from them.

Make a state with no icon - I'll call it Dummy for the sake of these instructions. Give Dummy the Trait State Resist: Knockout. Put a Troop Event into all of your troops that activates at Turn 0 and puts Dummy on the actor(s).

Using the VisuStella Battle Core, give the Dummy state this notetag:
Code:
<JS Post-Damage as Target>
if (target.hp<=1)
{
    target.setHp(1);
    target.addState(X);
}
else if (target.mp<1)
{
    target.setMp(1);
    target.addState(X);
}
</JS Post-Damage as Target>
Replace X with the ID of Vulnerable, no leading zeros.

In Vulnerable, give it the Trait State Resist: Dummy. Then here's the part I'm a bit uncertain of - you don't actually say that you want to lose Vulnerable if you get healed back up. But I'm presuming you do want that. If you don't, I'll label the code below to delete if Vulnerable should be permanent for the rest of the fight.

Give Vulnerable this notetag:
Code:
<JS Post-Damage as Target>
if (target.hp<1 || target.mp<1)
    $gameParty.removeActor(target.actorId());

// Delete these five lines if desired
if (target.hp>1 && target.mp>1)
{
    target.removeState(X);
    target.addState(Y);
}
</JS Post-Damage as Target>

Maybe it's what you'r looking for.
I don't see what the OP is describing in there. The closest is Guts, but that's not applying a new state and it doesn't key off of MP at all.
Don't know if this will work, but maybe if you made the actor have a state applied to him at all times that made him resist the "Death" state. Then, have a conditional that checks if the player has no HP or MP, and, if so, remove that Death Resisting State. If that makes any sense.
Or you could listen to the other smarter suggestions made by people who actually know what they're doing.
Thank you all! Brilliant suggestions here.

Original thread: https://forums.rpgmakerweb.com/threads/deaths-door-mechanic-possible.158401/