Actor health sets variable in battle (Need help)

Good day everyone, I am sorry to bother you all but I have a question that I believe may require a bit of scripting, but I thought I would ask in case anybody knows how to do it and could help me.

I am trying to make a method that will set a variable to a specific number when the player's characters get less than a certain point of health. Here is an example.

When Actor 1 (player controlled character) reaches less than 66% health, the variable 21 will be set at 66. When they drop to 33% health, the variable is set to 33. And this would continue to other numbers such as 25%, 20%, 15%, 10%, 5%, and 1%, with the variable corresponding like 25, 20, 15, 10, 5, and 1. Also though, if they heal back to above 66% health, the variable will be set to 95 (regardless of if their health is healed to 67% or 100% I want the variable to be set at 95). And if they were at 1%, and the variable was 1, and they heal up to 30% health, the variable will be set to 25.

I am also hoping for this to happen for Actor 2, 3 and 4 (again player controlled characters) but for variable 22,23, and 24.

I have a method that sets the enemy to a certain variable like described above, but my game is going to have over 100 actors so I can not use the same method as I would for the enemies.

Sorry if this was hard to understand. I am a little confused with how to explain it. I can clarify anything for anyone in about 12 hours if anyone needs it. Thank you to anyone that can help. I do not know how to script so if this needs to be done with scripting and it is easy I would really appreciate if someone can show me how it would look. Thank you everyone.

Original thread: https://forums.rpgmakerweb.com/threads/actor-health-sets-variable-in-battle-need-help.82919/