Undead/Zombie State (Using Yanfly Buffs&States Core)

Hi guys!


Today I have another question, I hope it can be resolved!


Currently, I'm using Yanfly Buffs&States Core and the autopassive states plugins to recreate the undead state of Final Fantasy X. The next youtube video shows how to use it in enemies but it can easly done for anything. However, it only works for healing abilities! (which is good, but not thaaaaat good). Healing abilities damages the heroes if they're inflicted with the undead state but, the HP regeneration heals a heroe even if they're undead. So my question is, Can it be possible to make that all types of healings hurts them instead of only abilities?

https://youtu.be/CILbgvxz7DA

PD: I tried modifying the rpg_objects file by changing the Game_Battler.prototype.regenerateHp but i don't know why it doesn't work. The code i placed instead of the default code:


Game_Battler.prototype.regenerateHp = function() {
var value = Math.floor(this.mhp * this.hrg);
value = Math.max(value, -this.maxSlipDamage());
if (this.meetsStateCondition == 48) {
if (value !== 0) {
value = value * -1;
this.gainHp(value);
}
}
else {
if (value !== 0) {
this.gainHp(value);
}
}
};


EDIT: Zombie State ID is 48.
I think you'd have to use a code on your regen state instead of using a trait, so that when a turn passes you gain the hp. Then if you are under Zombie it damages instead.
Thanks! Finally I got it!

If there's someone who wants the same, all you need to do is place the following code inside the healing state notebox. (Only valid with Yanfly B&S Core). As I said before, in my case the undead state ID is 48. Also, if you want a different healing value just modify it inside parseInt().

Code:
<Custom Turn End Effect>
if (this.isStateAffected(48)) {this.gainHp(parseInt(this.mhp * (-6/100)))} else {this.gainHp(parseInt(this.mhp * (6/100)))}
</Custom Turn End Effect>
Why not Custom Regenerate Effect instead of Custom Turn End Effect?
I'm not a script professional but, if i'm not wrong, Custom Regenerate Effect triggers whenever there's a regeneration (HP, MP or TP) so, basically, it needs a HRG, MRG or TRG xparam value to be activated. As you can see, I haven't used them so it wouldn0t work.
Also I think that Custom Regenerate Effect works after the regeneration it's done, but i'm not sure.

Custom Regenerate Effect>


code


code


</Custom Regenerate Effect>


This effect will run whenever the battler would regenerate HP, MP, or TP.


The code will process after all the other regenerate effects have ran.
As the text says, would regenerate. I think it means that if there is any usual regen/poison effect it happens then.


I said that because in a code made by Yanfly of a poison that damages based on the attacker's magic attack the damage was made there.
I supose you are talking about a Tip&Trick Yanfly's video. Do you remember which one is?
It wasn't exactly a Tips and Tricks, at least not as far as I know. It was shown in a video by Driftwood Gaming, but the person in the video said it was written by Yanfly.


http://driftwoodgaming.com/rpg-maker-mv/stat-based-dot/
After testing a little bit, I can conclude that it is better using the  Custom Regenerate Effec. Thanks for pointing it out!
I have a related question to this:

I'm looking to add to this Zombie state by allowing for an "Undeath to Death" skill that specifically kills Undead that I designate, or those who are affected by the Zombie state. The only caveat is that I don't the effect to display as damage. As a bonus, I am using HIME's Placeholder States to test the applying of a specific "Undeath to Death" state that when applied to Undead, applies the ID 1 death state instead.

Original thread: https://forums.rpgmakerweb.com/threads/undead-zombie-state-using-yanfly-buffs-states-core.69431/