[SOLVED]Restoring some % of HP\MP

Hi there.
I have a little problem. Will be pleasured if you help me.

I have an event on map, which must restore 25% Actor's Max HP\MP, but in Event Options I found only "Restore All".
If I try to "Change HP" it's changing max hp points of actor.

I have a Hp potion which restore 25% of Max HP, but event's options haven't "Use item" point

How I can make it? I'm far from JS coding (know basic info, can change some parts in already complete code, but write from 0...)
In control variables, you can select game data. From there select actor and their max hp.
----(disregard this line)Next, select that same variable again, select mul for multiply, and in the script box write .25

Now, the variable will hold the value for 25% of their hp.
With the change HP event command, you can use that variable.
If you want, there are more flexible ways, but it would involve JS. I don't mind writing it up, but I'd need more info.

Let me know if this solution suits your needs, though.

EDIT:

Instead, in the script box write $gameVariables.value(id) * .25
Replace id with the value of variable you stored the actor's hp in.
Sorry about that.
If I try to "Change HP" it's changing max hp points of actor.
that is wrong - change HP does NOT change the max HP but the current HP.

MaxHP is a parameter, and is changed by the "change parameter" command. Somehow you confused those two
Hi there!
There is a simple way to do that.
Here I will show you 3 ways ^^

Just copy these codes and put the one that suits you in a script call field.

For recover a % of the MAX Hp and MAX Mp of the entire group:

Code:
var all_actors_Id = [1, 2]; // Put the actor Id here.
var rhp = 25; // Number of the % you want to heal.
var rmp = 25; // Number of the % you want to heal.
// Don't change below that.
all_actors_Id.forEach(function(actorId) {
    $gameActors.actor(actorId).gainHp(Math.round($gameActors.actor(actorId).mhp * rhp / 100));
    $gameActors.actor(actorId).gainMp(Math.round($gameActors.actor(actorId).mmp * rmp / 100));
});

For recover a % of the leader Max Hp/Mp only:

Code:
var rhp = 25; // Number of the % you want to heal.
var recoverhp = Math.round($gameParty.leader().mhp * rhp / 100);
$gameParty.leader().gainHp(recoverhp);
//
var rmp = 25; // Number of the % you want to heal.
var recovermp = Math.round($gameParty.leader().mmp * rmp / 100);
$gameParty.leader().gainMp(recovermp);

For recovering a % of a specific Actor Hp/Mp:

Code:
var ACTORID = 1; // Put the actor Id here.
var rhp = 25; // Number of the % you want to heal.
var recoverhp = Math.round($gameActors.actor(ACTORID).mhp * rhp / 100);
$gameParty.leader().gainHp(recoverhp);
//
var rmp = 25; // Number of the % you want to heal.
var recovermp = Math.round($gameActors.actor(ACTORID).mmp * rmp / 100);
$gameParty.leader().gainMp(recovermp);
Hi there!
There is a simple way to do that.
Here I will show you 3 ways ^^

Just copy these codes and put the one that suits you in a script call field.

For recover a % of the MAX Hp and MAX Mp of the entire group:

Code:
var all_actors_Id = [1, 2]; // Put the actor Id here.
var rhp = 25; // Number of the % you want to heal.
var rmp = 25; // Number of the % you want to heal.
// Don't change below that.
all_actors_Id.forEach(function(actorId) {
    $gameActors.actor(actorId).gainHp(Math.round($gameActors.actor(actorId).mhp * rhp / 100));
    $gameActors.actor(actorId).gainMp(Math.round($gameActors.actor(actorId).mmp * rmp / 100));
});

For recover a % of the leader Max Hp/Mp only:

Code:
var rhp = 25; // Number of the % you want to heal.
var recoverhp = Math.round($gameParty.leader().mhp * rhp / 100);
$gameParty.leader().gainHp(recoverhp);
//
var rmp = 25; // Number of the % you want to heal.
var recovermp = Math.round($gameParty.leader().mmp * rmp / 100);
$gameParty.leader().gainMp(recovermp);

For recovering a % of a specific Actor Hp/Mp:

Code:
var ACTORID = 1; // Put the actor Id here.
var rhp = 25; // Number of the % you want to heal.
var recoverhp = Math.round($gameActors.actor(ACTORID).mhp * rhp / 100);
$gameParty.leader().gainHp(recoverhp);
//
var rmp = 25; // Number of the % you want to heal.
var recovermp = Math.round($gameActors.actor(ACTORID).mmp * rmp / 100);
$gameParty.leader().gainMp(recovermp);

Wow! It's really works! Thanx!) I tried something like that

$gameParty.members().forEach(function(m){
m.gainHp(Math.round(1*(m.mhp)));
m.gainMp(Math.round(1(and changing here to 0.5 and 0.25)*(m.mmp)));
});

But that doesn't work at all.

Thank all of you guys for answers!
Just for info, you don't need scripting for this (though a script, if you understand it, is more succinct). Control Variables > Game Data > Actor > Max HP can get an actor's max HP, then you can divide by 4 and change HP by that amount, e.g.
Code:
◆If:Harold is in the party
  ◆Control Variables:#0001 heal = Max HP of Harold
  ◆Control Variables:#0001 heal /= 4
  ◆Change HP:Harold, + {heal}
  ◆
:End

Original thread: https://forums.rpgmakerweb.com/threads/solved-restoring-some-of-hp-mp.111757/