Making Variables Check Health Percentages?

Hello, everybody. Just a quick question:

I've been trying to set a variable (in a common event) to a certain percentage (in this case, 10%) of one's maximum HP, then use a conditional branch to check if their current HP is less than the variable. After trying to use the classic 'divide health by max health and multiply by 100', I realized that RPG Maker cannot handle decimal values, and that the variable value will always remain at 0 as a result.

For further information: the goal in my game is not to reduce the opponent's health to 0 per se, but reduce their health enough and knock them down, where you can 'pin' them. The guard option was replaced by a 'pin' command, which sets off a common event. Said common event counts to 1, then checks the opponent's current and max HP to check if the opponent's current HP is less than 50% of their max HP. If the condition is met, it counts to 2, then checks if the opponent's health is less than 10% of their max HP. From there, if that condition is met once more, a three count will be made, and the battle is ended.
There is what I can only describe as a counter-intuitive move in dividing variables.

Set variable #1

Operand 'set'

Game data - Actor's MHP

This is the counter-intuitive bit.  You use the same variable to get the division

Variable #1 

Select 'Div' and in the operand put 10 (if you want 10%)

Variable #2

Actor's HP

Conditional

Variable #2 is less than variable #1
Another way to do it is do the first part of the above to get the players hp.

Then using the same variable select multiply (Mul) and in the script box put in 0.1 for 10%.

Then you can do the conditional like the above.
The problem is that the variables are integer by default, and integers always drop decimals.


But the easiest solution to that is to make the division the last operation: First multiply by 100 and then divide by max health to get the percentage value.
Another way to do it is do the first part of the above to get the players hp.

Then using the same variable select multiply (Mul) and in the script box put in 0.1 for 10%.

Then you can do the conditional like the above.
Silly me tried to use multiple variables to store the half and 10 percent hp values when I could have simply used the same max HP variable instead.

I tried multiplying by 0.1 in the 'constant' section to no avail, I didn't know that using the script box would work as well.

So would all three suggestions work in this case?
Script Call:

x = $game_actors[actor_id].param(0) ; x *= 0.1$game_variables[variable_id] = xWhere 'actor_id' is the number of an actor in the database whose MHP value you need and 'variable_id' is the id of the variable in which you'll store 10% of the actor's MHP value.

Original thread: https://forums.rpgmakerweb.com/threads/making-variables-check-health-percentages.41917/