Change an enemy's maximum HP (Resolved)

Hello,
I need your help once again.
In my game, one of my characters has a shapeshifting spell. Concretely, I use the function transform the enemy and it works rather well.
My only concern is that the enemy now has the transformation stats. I fixed the problem for MP, strength and defense, but HP is an issue.
Is there a possibility to change the maximum HP of an enemy using a variable?
Because the enemy retains its current HP, but the poison effects are based on a negative regeneration of the maximum HP

(Translation made by google, please ask me to rephrase if necessary).
Can you show what you have? Max HP is a parameter in the same way those others are, whatever you are doing to change them should work on HP also.
In reality, I should have said that I worked around the problem for the other parameters.
My enemies all have infinite MP
The transformation uses an attack that removes about 5% of the hero's maximum HP from the attacked hero (so it doesn't matter the value of his strength).
For several reasons, I decided to put 1 defense on all my enemies. I regretted not having done so in my last game.
Luck is not really visible to the player.
There remains the speed... I told myself that the transformation could be slow. It doesn't seem shocking to me. Transform is just a fun ability for non-boss targets.

So I have nothing at all ^^"
I don't know java script at all. I'm happy to reuse the formulas that members of the forum have already given me when possible. But in this case...
please show us what you have done - as in screenshot of the event or skill or whatever that does the transformation.

there are too many ways to handle transformations, and we can't tell what you did wrong without seeing what you did.
"Because the enemy retains its current HP, but poison effects are based on negative regeneration of maximum HP."

From the french you wrote. Are you saying you want the transformation to also be a full on HP restore when the new Max takes affect? Like 80/200 -> 250/250, because the poison is working as intended, but I guess you don't want poison to kill someone who just transformed if they had low current HP for any reason.
Andar: Unfortunately, I'm not at home right now. I will show you as soon as possible. But I just created a spell that calls an event that transforms the enemy. Nothing more.

Arctique: that's not it.
I would like the enemy to retain their current HP.
80/200 ==> 80/250
And I would even say ==> 80/200. That's my problem.
Polymorph will be a spell that the player can use from start to end of the game to turn an enemy into a frog. But at the beginning of the game the enemies will have maybe 500 HP while at the end it will be maybe 30000.
So I created an enemy with the appearance of a frog which will be the result of the transformation every time. My first idea was to give him 99999HP, so that the enemy keeps his current HP whatever their value (400/500 ==>400/99999 or 25000/30000 ==> 25000/99999), the important thing is that the player has the impression that it is the same enemy.
The problem is that if that enemy is poisoned and transformed, the poison is going to deal damage to them based on 99999. So I would like to be able to give them their original max HP.

I hope I have explained well, and that the translator will not distort too much

Édit : Sorry, I just understood that part of my first message has been automatically translated into French v_v
Indeed you have explained it well. I'm gonna throw some ideas out there:

Sounds like you just need some gameVariables to store oldMax HPs and a 'faked' poison skill/state(probably another event) that substracts(as a percentage) HP based on the oldMax stored in the gameVariable and return that value as damage. If it's not too complex, you shouldn't need any script calls and just do it all in battle events as the control variables can store oldMaxes at the beginning and when a transformation occurs, it can begin working off the variables.
With that added info, I think you're going the wrong way.
your problem isn't the HP value itself, your problem is that the poison is based on a value that changes.

So I think a better solution would be to go after the poison state itself instead of a complex workaround.

There are several plugins that allow you to define other effects for states and their use through javascript code.
Use one of those to redefine what your poison is based on and have it ignore the transformation.
If you have problems with javascript notetags, just ask here in a forum how the javascript for your effect should look like.
OK thank you. I'll check it out as soon as I can and let you know if it worked
After a lot of time, I can't find a solution. I think I'm not good enough in handling scripts.
Another solution came to me but it will be very long. Create a custom transformation for each enemy in the game. It might take me a whole day to program the event but I just spent hours looking for something that I couldn't find so...
Thank you for trying to help me.
I think I'm not good enough in handling scripts.
then ask for what to do.

The only reason why we can't give you a complete solution as of now is that you never gave a full description of what you want - including values and examples.
if you ask for the specific code to do something, you usually get it from here.
but no one can read your mind or guess what you're thinking or doing, so any specific help always waits for the details to be written and screenshotted here.
Sorry, thought I was specific.
I show you what I did (sorry it's in French), then I explain it to you, and finally I'll tell you exactly what I want (if possible).

3.png


1.png


2.png


For the moment it is very simple.
I created a spell that has a 70% chance of inflicting the "Maléfice" state on an enemy.
Then I call a common event that will just check if the enemy has the Maléfice state (I check the 8 potential enemies).
If one of them has the Maléfice, he is transformed into an enemy that looks like a frog. Then I remove the Maléfice state from all enemies.

What I'd like to do is be able to modify the frog's maximum HP afterwards based on a random variable.
I can adjust the value of the variable am the maximum HP of the enemy affected by Maléfice. Then transform it. And finally set the maximum HP on the variable, maybe using a script if it exists).

Was I specific enough? Do not hesitate to ask me for details.

Édit : If someone knows how to transform an enemy without changing their stats, that's even better. I just got the idea. It would simply change the image (the skin).
It can be a solution

Édit 2 : Looks like no one is more inspired. However, I found a solution quite by accident. The Weak enemy poses plugin from yanfly allows you to change the image of an enemy according to its HP... or according to a state
I'll mark the topic as solved when I try.

Original thread: https://forums.rpgmakerweb.com/threads/change-an-enemys-maximum-hp-resolved.148117/