MZ Is there a script line to increase an enemy's HP of more than 9999?

Like 999,999 instead?
Hiya,

You use Visustella plugins, correct? With the main core, you can add a notetag to enemies to exceed database limitations of stats, including max hp: http://www.yanfly.moe/wiki/Core_Engine_VisuStella_MZ#Enemies-Related_Notetags

So, if you wanted to adjust the HP, you'd add <maxHP: 999999>

Though from what I understand of the default database, can you not set it to 999999 by default in the database? Unless you were meaning something else!
Sorry I meant to recover HP, I just want to avoid doing:

HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
HP recover: 9999
etc etc etc

If I can just have it in one line?
Ah, I see!

In this case you could use something like:


Code:
$gameTroop.members()[0].gainHp(999999)

In a script call I believe. With the number in the square brackets being the index number of the enemy in the troop, with 0 being the first, etc.

That should add the hp, and if you wanted to remove the hp, add a minus to the number.
Is there a way to do it for all (enemy) troops?
Is there a way to do it for all (enemy) troops?
You could do it a couple of ways:
JavaScript:
$gameTroop.members().forEach(mem => mem.gainHp(999999))
For only alive members:
JavaScript:
$gameTroop.aliveMembers().forEach(mem => mem.gainHp(999999))
Using a for-of loop to exclude specific member indexes (in this case, enemy #3, #5, and #6):
JavaScript:
for (const mem of $gameTroop.members()) {
    if ([2, 4, 5].includes(mem.index())) continue;
    mem.gainHp(999999);
}
You could also give the enemy a skill and have the skills damage formula just be the HP you want them to recover. Unless you got a plugin that limits damage or caps max healing you can do any value you want there.

Can also do percents that way. Like b.mhp * 0.50 in the damage formula for a healing skill and it will recover 50% of their max HP.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-script-line-to-increase-an-enemys-hp-of-more-than-9999.170873/