Sap, Disease state snippet

I need a little help. I'm looking for a script/snippet that allows me create states like Sap or Disease.
It is poison state which also reducing(or set) MHP to actual HP, but not less than 1.

I tried pinning something like:

this.mhp = this.hp; // also tried this._hpif (this.mhp < 1) {this.mhp++;} // or {this.mhp = 1;}in many parts rpg_object.js file for detect which part i should edit/modify but without succes.

That's why I request this snippet.

It would be nice if it will working with notetags like <sap> and <mpsap>(MP instead HP).

Thanks in Advance.

Original thread: https://forums.rpgmakerweb.com/threads/sap-disease-state-snippet.52301/