State Sprites

Alright, so this is an idea I've had for a while and seems in my mind like it would be a cakewalk for somebody who knows scripting.

The idea is this - when the player/party leader is inflicted with a state their sprite changes to reflect it.  Likewise when the state fades their sprite returns to normal.  This is something I haven't been able to do successfully with common events or other means and seems best to have handled by a script.

The user part of the script would be fairly simple
(Actor ID, State ID, Sprite File Name, Index (if needed)) - and it should always revert to the proper actor sprite when the state fades or is destroyed. 

(A note: If the user gains multiple states it should ignore the new sprite change request and maintain the first -if two are applied by the same attack, item, ability - then the state with the higher priority rating should be drawn.)     

Original thread: https://forums.rpgmakerweb.com/threads/state-sprites.39548/