Block party from access if party member(s) are dead.

I've looked, but I can't seem to find an answer to this:

So I want it where the player will be blocked from entering specific places if a party member is dead. They have to revive the party member first before they will be allowed in. It's easy to check if one party member is dead by just checking their individual state, and just using a conditional statement, but I'm trying to find a way to check the state of everyone in the party at once to see if they have the death state . . . or, more specifically, if two or more have the death state. (The party will have a total of 3 people, with a 4th sometimes joining in for a time, and then leaving. If the main party member dies, it'll just be a Game Over and I already have that set up).

Also, is there any way to track how long a party member has had the death state for? I would love to set up a time-limit for reviving a dead party member, or even just have a thing where one of their stats will be lowered a bit if you wait to long to revive them (like their Agility will go down 1 or something).
I haven't used MV, but you could:
Set a boolean to false.
Check if character A is in the party. If so, check if A is dead or not.
If A is dead, then set the boolean to true.
If the boolean is true, it's over. Call the routine where the heroes don't get permission.
If the boolean is false, pass on to the next one.
Check if B... etc.
Once you've finished, if the boolean is false, they're allowed in.

About the other thing, you could do it via code. For example, have a two attributes for each character where one of them is whether they are dead or not, another with the moment they were killed (use play time for that).
Now you have to add a few lines everytime a hero is killed setting the value to "dead" in the former and putting the time in the latter, and check and compare that time whenever a hero is revived.
Okay, I was able to set up the first part of my question via Switches (which I assumed was the MV version of Booleans) and some "IF" statements. So thanks @BitBrosGames it worked just like I wanted.

I'm, still trying to figure out how to work out the second part. Were you saying I should write a script? Because I'm not really good at that.
I'm trying to find a way to check the state of everyone in the party at once to see if they have the death state . . . or, more specifically, if two or more have the death state.

You can also do Control Switches with the "script" option and put
Code:
$gameParty.deadMembers().length >= 2
That would turn a switch ON if there are 2 or more dead party members.
For the second part, if you want to track how many turns in battle have passed, reserve a Variable for each party member. Make a Troop Event that runs each turn of every battle (set scope to Turn, and condition to a Switch that is always On). In that Troop Event, check (using Conditional Branch) whether each member is dead. If so, increase their Variable by 1, and do whatever other processing you need to. If NOT, then set their Variable back to 0.

If you need to check how long it's been outside of battle, that's a bit trickier. I would probably create a Common Event that is always running (by making its condition a Switch that's always On), and having it run every X seconds (by adding a Wait command to the end of the Event, where the Wait is equal to 60 * X). Inside that event, you want to do the same checks as the above: check whether each member is dead; increase their variable by 1 and do appropriate processing, or set to 0.
Thanks @Wavelength! I've modified your suggestion just a bit, since I have a custom in-game clock already created, (there are 26 hours in-game for the world) and I want the death of characters to match the in-game time, so I just gave each character a similar clock that will trigger and begin to run when a Switch turns ON when they have a death state using a Base Troop Event. Same thing with outside of battle, using Common Events. And the clocks will reset when the Switch is OFF.

Anyway, thanks everyone! Now I can have death having some consequences in my game.

Original thread: https://forums.rpgmakerweb.com/threads/block-party-from-access-if-party-member-s-are-dead.111380/