How to prompt message before game over?

I am nearly finished developing an Escape the Maze mini-game meant to be played in one sitting.

I have two factors of health:
1) Every 3 seconds the player loses 1 HP.
2) Whenever the player gets damaged by a trap/monster on the map, the player loses 10 HP.

In order to end the game, the play must collect the key from Floor 10 or reach 0 HP.

How can I show a message when the HP reaches 0 before the game over screen appears? Any event template would help greatly. The purpose of it is to inform the player that the challenge is over and to take a screenshot of their score.
I am nearly finished developing an Escape the Maze mini-game meant to be played in one sitting.

I have two factors of health:
1) Every 3 seconds the player loses 1 HP.
2) Whenever the player gets damaged by a trap/monster on the map, the player loses 10 HP.

In order to end the game, the play must collect the key from Floor 10 or reach 0 HP.

How can I show a message when the HP reaches 0 before the game over screen appears? Any event template would help greatly. The purpose of it is to inform the player that the challenge is over and to take a screenshot of their score.
I would either use a plugin like CT_Bolt ObjectsEx to monitor the HP in a Control Variable and run a script every time HP is changed:

Example:
if($gameVariables.value(1)<=0){
$gameTemp.reserveCommonEvent(ID) //Run common event where you show a screen with game over text and player score
}

Or every time an event does damage to the player, call a common event that does the same thing: check if the HP is 0. If it is, play the game over screen

Original thread: https://forums.rpgmakerweb.com/threads/how-to-prompt-message-before-game-over.159673/