Change enemy/ character color when affected by a state.

I need a script that changes the enemy's and characters' colours when affected by a certain state. For example: when affected by "petrify", they become all grey, or when affected by "zombie", they have all their colours changed. This script should let me choose the battler/character RGB colours configuration via notetags.

I'm using Victor's Actors Battlers script, which gives graphics for actors, so the script I requested must affect characters too. The color changes must be only during the battle.
I know its not exactly what you want, but you could use the Yanfly's State Animation to make it a little uniques.
Well, I managed to visually implement the petrify state.
Well, I managed to visually implement the petrify state.
Thanks, it worked like a charm.
Well, I managed to visually implement the petrify state.
I discovered a bug: when I use the event command that heals the entire party, the petrified state disappears, ok, normal, but the sprite color does not return to normal, continues grey. Please, can you fix it?

Original thread: https://forums.rpgmakerweb.com/threads/change-enemy-character-color-when-affected-by-a-state.158424/