HP bar changes color depending on current health

I need a script that changes the HP bar's color (and the current HP number's color) to reflect the current condition of the actor. For example, if Eric has 15% of his maximum HP, the bar and the text turns red. This script needs to work both in menus and in battles.


Prerequisites:

  • Compatibility with Yanfly Engine Ace and Yanfly Ace Battle Engine.
  • Must be customizable, preferably like RGBA style of picking color (picking two colors to make one bar). Text color must use the Window graphics file.
  • Three levels where the color changes. Normal, Warning, Danger.
A few days after I posted this request, I have figured out on how to achieve this. So, it's no longer needed.

Original thread: https://forums.rpgmakerweb.com/threads/hp-bar-changes-color-depending-on-current-health.69728/