HELP with Variable Checker Opitimization

I'm currently developing a game with 4 characters in the MV. I don't use the status system and what determines if a character died are variables. I am at an impasse to determine when a character is dead or alive, as in the future it could give a bug with the way in which the check is read. Basically, it checks if that switch is active, if not the code will check if another switch is active, so until it checks all the switches that determine if the character is alive or not. This in the future could generate an error in the code, where if a previous character was already dead it would not check if the others were still alive or not. I decided to move to variables so each character would be determined by a number in the variable (1234 would mean all characters are dead, 13 would mean only characters 1 and 3 are dead). But even then they would still be pretty bad, because I would have to do 16 checks for a single code. Could someone help me to optimize this system?

[btw, my english is very bad, then i used the google for translate all the text (srry the laziness). if u wanna ready the original text, here it is: V]

Spoiler: Original Text [PT/BR]
Atualmente estou desenvolvendo um jogo com 4 personagens no MV. Não uso o sistema de status e oque determina se um personagem morreu são variaveis. Estou num empasse para determinar quando um personagem está morto ou vivo, pois futuramente poderia dar um bug com a forma na qual a checagem é lida. Básciamenete, checa se tal switch ativa, se não estiver o código vai checar se outra switch está ativa, assim até checar todas as Switch que determina se o personagem está vivo ou não. Isso futuramente poderia gerar um erro no código, onde se um personagem anterior já estivesse morto ele não iria checar se os outros ainda estariam vivos ou não. Decidi migrar para as variaveis, assim, cada personagem seria determinado por um número na variavel (1234 significaria que todos os personagens estão mortos, 13 significaria que apenas os personagens 1 e 3 estão mortos). Mas mesmo assim ainda seria bem ruim, pois teria que fazer 16 checks para um único código. Alguém poderia me ajudar a otimizar esse sistema?
Moved to: MV Support
The method I often use for this kind of thing is assigning sequential powers of 2. So actor 1 is 1, actor 2 is 2, actor 3 is 4 and actor 4 is 8. You add their value to the variable when they die, and check whether they're dead by subtracting their value from it and seeing if the total is still greater than or equal to 0.
What are your checks designed to do? If you need to have a different result for every possible combination of deaths, then you'll need 16 checks as you'll have to send it into 16 different results. But if you just want to check something like "everyone is dead" or "exactly one person is dead" there should be easier ways to do it.
I’ve had to deal with this before, myself. I did it as basically a binary value — five digits, each either 0 or 1 — but it amounted to the same idea.

If you have four variables (or, in this case, one variable with each digit effectively representing a variable on its own), you’ve got sixteen different possible outcomes. If you’re lucky (like I was in my own example), some of the possible values aren’t possible or will have the same effect on gameplay as other options. That will decrease how much you have to sort out, but there’s not really any shortcut to coding it beyond that.
I don't fully understand what you are trying to do in detail. Here a Check for how many Actors alive.

Code:
Var1 = 0
If Var2_Actor1HP > 0
if yes, do: Var1 += 1
end
If Var3_Actor2HP > 0
if yes, do: Var1 += 1
end
If Var4_Actor3HP > 0
if yes, do: Var1 += 1
end
If Var5_Actor4HP > 0
if yes, do: Var1 += 1
end

If Var1 = 1
1 Actor Alive
end
If Var1 = 2
2 Actors Alive
end
If Var1 = 3
3 Actors Alive
end
If Var1 = 4
4 Actors Alive
end

Original thread: https://forums.rpgmakerweb.com/threads/help-with-variable-checker-opitimization.154659/