Death State Removes Actor

    I want to create an effect of, when a party member is killed, if they are not revived after an amount of turns,  they are removed from the party.


I think this can be done using Yanfly Buff and States Core but I'm not sure how to go about it.


    I was thinking of having the death state have a turn limit, and the remove from party effect would occur when it expires on it's own, but would not occur if it is cured by an item or skill.  


    I was also hoping it would be possible to set the amount of turns the death state lasts, and it be equal to the characters LUK stat.
This might work.


<Custom Leave Effect>


 $gameParty.removeActor(n)


</Custom Leave Effect>


<Custom Remove Effect>


 nothing goes here


</Custom Remove Effect>


From Buffs and States Core:

Spoiler
Quick Reference:


- Apply: When a state is added.


- Remove: When a state is removed.


- Leave: When a state expires by reaching 0 turns.



If that doesn't work, maybe this will (requires YEP_BattleEngineCore.js)
 


<Custom Turn Start Effect>


user._deathTurns += 1;


if (user._deathTurns >= 3) {


    $gameParty.removeActor(n)


}


</Custom Turn Start Effect>


Please note I'm not that experienced with js, and I'm not at home, so I can't check this stuff out..
  Thank you for the response.  This seems good, however I am not certain how to retrieve the actor id value.


  Also it occurs to me than enemies will automatically revive, so I'd need to remove them as well upon expiration.

Original thread: https://forums.rpgmakerweb.com/threads/death-state-removes-actor.66115/