Go into the database and open up the common event tab. Make a new one, and make it 'Parallel Process' and set the switch trigger to one that you haven't used yet. In event commands, you'll see the control variable option on the first page. Go into it, and set 1 variable to equal each actor's HP. There is an option for this. This means if you have 4 actors, you'll need 4 variables.
Next, make a conditional branch (also on the first page in event commands) to check if one of the variables is equal to 0. That option is the second one on the first page of the conditional selections. Uncheck the else box, you won't be needing it. Inside the branch, run an 'Abort Battle' or 'Gameover' command as you deem fit. Make a branch for each of the variables.