Yanfly's Lifesteal in Status Screen

I'm trying to get an actor's lifesteal % stat (Yanfly lifesteal plugin) in the status menu in the attribute section. This is what I've added to the status menu plugin so far to try to get it to work (my status menu plugin is below my the lifesteal plugin):

Lines 330-332:

* @param lif Name
* @desc The text name used for this attribute.
* @Default Lifesteal

Line 503:

Yanfly.Param.StatusAttr_lif = String(Yanfly.Parameters['lif Name']);

Lines 1173-1176:

case 'lif':
this.drawAttributeName(Yanfly.Param.StatusAttr_lif, dx, dy, dw);
//alert(actor.id);
this.drawAttributeRate(actor.lifeSteal.hpPhysicalRate, dx, dy, dw);

The last part is what doesn't work. actor.lifeSteal.hpPhysicalRate comes up as NaN (not a number).

Any ideas how to do this? Lifesteal is going to be a pretty big part of my game. Thanks for any help!
I wish I knew how to help you figure this out, but the least I can do is direct you to a place where you might find an answer:
https://www.reddit.com/r/rpgmaker_howto/
Instead of using this gimmick plugin, why don't you use skill core function to make the life leech based on a parameter?
That would appear on the status without trouble.

All you would need is SP-P you don't use like floor damage rate or guard effect.

Then on the skills that are leechable, put a <Post-Damage Eval> with

user.gainHp(Math.floor(value * (user.fdr - 1)))

This mean at 50% extra FDR, and you do 200 damage, you will gain 100 hp from the leech(50% life leech)
Lolshtar has a good idea here. The only thing I'd add to it is once you pick a s-param (or x-param) that you are not using at all in the game, go to the plug-in which displays the name of the parameter and change the displayed name so that the players are not confused. For instance, I use Yanfly's Status Menu, and in there I changed the display name to match what I was really using it for. That way the player doesn't get confused.
Instead of using this gimmick plugin, why don't you use skill core function to make the life leech based on a parameter?
That would appear on the status without trouble.

All you would need is SP-P you don't use like floor damage rate or guard effect.

Then on the skills that are leechable, put a <Post-Damage Eval> with

user.gainHp(Math.floor(value * (user.fdr - 1)))

This mean at 50% extra FDR, and you do 200 damage, you will gain 100 hp from the leech(50% life leech)

This worked great thank you. I ended up using an x-param because they add instead of multiply. Also I added an if statement because battlers that don't have any lifesteal get a "0" popup which is annoying. This is what I did:

<Post-Damage Eval>

if (user.cev != 0) {

user.gainHp(Math.floor(value * user.cev))

}

</Post-Damage Eval>

I'll have to decide if I want to stick with cev as my x-param. Thanks!
Great job
I know it's been a little while but do anyone have any thoughts on how to get Yanfly's bloodthirster tips & tricks to work with this other lifesteal method? any help on that would be great!
user._hp = user.mhp - user.hp
user._LS = Math.floor(value * (user.cev))
if (user._LS > user._hp) {
user.gainHp(user._LS)
user._LS = user._LS - user._hp
user.gainBarrier(user._LS) }
if (user._LS <= user._hp) {
user.gainHp(user._LS) }
Thanks for the help! When I first copy/pasted your code it made my actor take damage when attacking. I'm not sure why. I fiddled with it and ended up with this:

<Custom Establish Effect>
var missinghp = user.mhp - user.hp;
var lifesteal = Math.floor(value * user.cev);
if (lifesteal > missinghp && value > 0 && this.isHpEffect()) {
var overheal = lifesteal - missinghp;
user.gainBarrier(overheal, 2);
}
</Custom Establish Effect>

This is in my bloodthirster state which is a passive state applied by the "bloodthirster" weapon. I'm taking care of the user.gainHP thing in each skill that is capable of lifestealing so I took it out of this state.

When I changed the code to declare variables like: var missinghp = blah blah, that's when it started working. Are those variables on yours (user._hp and user._LS)? what does the "_" do? does it just differentiate it from user.hp for example? How does the code know it's a variable if it isn't declared by "var"?

Anyways, it works! thanks a ton!
user._hp is a variable that can be named anything, it has nothing to do with user.hp

it's almost the same thing, expect that var cannot be specific to a target or the user while something like user._lifesteal is a variable specific to the user that can be used for later.

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-lifesteal-in-status-screen.75968/