MV Getting an Actor Variable help

Hi All,

I am currently making a regenerate state using yanflys buffs and states core. This is what I've got so far:

<Custom Regenerate Effect>
var m = $gameActors.actor(person affected by state)
var d = Math.round(0.1*m.mhp)
var KO = false
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);
</Custom Regenerate Effect>

It works how I would like it to if I specify which actor to use in the text in red. But what I need help with is what do i put there so it chooses just the actor that has this particular state.

I would imagine it would be something like: $gameActors.actor(this.Actor) or $gameActors.actor(target)

Hopefully someone here can help me get on the right track.

As always thanks in advance for any help.
If you read through the plugin instructions, you'll see the user variable is provided to you.

But the rest of your code is also incorrect. You wouldn't call a prototype of a function like that, and it would fail anyway because what you're trying to pass as this isn't a Game_Interpreter object.

Your notetag would simply be:
Code:
<Custom Regenerate Effect>
user.gainHp(Math.round(user.mhp*.1));
</Custom Regenerate Effect>

You might want to look through the pinned thread in the Learning JavaScript forum that has MV Script Calls, or reference the MV library:
If you read through the plugin instructions, you'll see the user variable is provided to you.

But the rest of your code is also incorrect. You wouldn't call a prototype of a function like that, and it would fail anyway because what you're trying to pass as this isn't a Game_Interpreter object.

Your notetag would simply be:
Code:
<Custom Regenerate Effect>
user.gainHp(Math.round(user.mhp*.1));
</Custom Regenerate Effect>

You might want to look through the pinned thread in the Learning JavaScript forum that has MV Script Calls, or reference the MV library:
Thank you so much! Sorry, I didn't see that in the notes.

I've been to that MV Library. Unfortunately, I never could quite understand how to use what its telling me and make it into anything usable. Probably because I'm rather limited in my javascript knowledge.

And I'm currently using a google doc with a collection script calls that I got from the forums.
That's what got me to where I was. I'm not sure if this is the same thing you were referring too as I couldn't find anything in the pinned threads on the Learning Javascript section. But I only quickly looked so it might be a little bit burried or as we already found out with the notes in the plugin, I may just be blind and missed it, haha. But your method got me there, so again thank you so much.
Sorry, I guess it's in MV Support, not Learning JavaScript. But yes, that's the document.

Original thread: https://forums.rpgmakerweb.com/threads/getting-an-actor-variable-help.157781/