MV YEP Buffs & States Core Mini & Frog States Assistance

Sorry for the delayed reply. Real-life was happening. We are getting closer to resolution. Lines one and two in the attached console screenshot show the enemy's starting MHP (999,999). Lines three and four show the MHP correctly carried over after the enemy was placed in FROG state. However, lines five and six show the enemy's MHP after FROG state was removed INCREASED to 10,000,000. Not sure why removing the state would cause an increase in the enemy's MHP. Really weird. The current script is below:

<Custom Apply Effect>
if (user.isEnemy()) {
user._prevEnemyId = user._enemyId;
user._origParams=user.enemy().params;
user._origHp=user.hp;
var transformEnemyId = 247;
user.transform(transformEnemyId);
for (var i=0; i<user._origParams.length; i++)
user._paramPlus=user._origParams-user.param(i);
user.refresh();
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) {
user._origHp=user.hp;
var transformEnemyId = user._prevEnemyId;
user.transform(transformEnemyId);
user._prevEnemyId = undefined;
user.hp=user._origHp;
user.refresh();
}
</Custom Remove Effect>
You should make sure to use the CODE tag (the </> icon) when you're posting code, otherwise anything in brackets can be interpreted by the forum as BBCode and not display. You can see in your post where it doesn't show [i], instead thinking it's for italics.

It's probably not overwriting the paramPlus array when you change back, so just reset it to 0:
Code:
user._paramPlus.forEach(x => x=0);
You should make sure to use the CODE tag (the </> icon) when you're posting code, otherwise anything in brackets can be interpreted by the forum as BBCode and not display. You can see in your post where it doesn't show [i], instead thinking it's for italics.

It's probably not overwriting the paramPlus array when you change back, so just reset it to 0:
Code:
user._paramPlus.forEach(x => x=0);
Where does the new line go? Please see below:

JavaScript:
<Custom Remove Effect>
if (user.isEnemy()) {
  user._origHp=user.hp;
  var transformEnemyId = user._prevEnemyId;
  user.transform(transformEnemyId);
  user._prevEnemyId = undefined;
  user.hp=user._origHp;
  user._paramPlus.forEach(x => x=0);
  user.refresh();
}
</Custom Remove Effect>
That should do it, presuming that's the cause.
This is a great thread you started @jcmtexas01 . You get a state that multiplies ATK by 25% then makes the target transform into a frog during the state.

I read about Enemy Transformations and I'm curious how you'll retain the other original traits of the target. From what I understand, the transform() method replaces all traits, not just the basic parameters e.g. MHP, ATK, etc.

What about the extra parameters (e.g. HIT, EVA, CRI, MEV, MRF, CNT, HRG), special parameters (e.g. REC, PDR, MDR) and other traits (e.g. Element Rate, State Rate, State Resist, Attack Element, etc.)? If these aren't returned to the original your FROG state is overpowered. For example, if the enemy has immunities / high resists, this state will nuke them even after the state has ended which is certainly not what you're after.

Spoiler: Three Possible Scenarios
  1. FROG state meant for single or small number of enemies.
    Spoiler
    Why not just use Enemy Transformations as is and copy the original's stats and traits to the frog battler and 25% ATK added to the FROG state?
  2. FROG state meant for any enemy, transform() method used.
    Spoiler
    If you can somehow manually revert a single enemy's traits you will then need a very large conditional to account for all possible enemies that can be affected by the FROG state and all their possible traits that need to be reverted.
  3. FROG state meant for any enemy, another method used.
    Spoiler
    It's better if you can find another method that doesn't involve nuking a target's stats and traits and then reconstituting all of them. After all, without the transformation your FROG state is just a plain vanilla state where ATK is multiplied by 25%.

By the way, it seems someone had solved something similar to your MINI state. Change size with a state
That should do it, presuming that's the cause.
No dice, you are correct that there could be another underlying cause, but given the HP increase, I am at a loss.
This is a great thread you started @jcmtexas01 . You get a state that multiplies ATK by 25% then makes the target transform into a frog during the state.

I read about Enemy Transformations and I'm curious how you'll retain the other original traits of the target. From what I understand, the transform() method replaces all traits, not just the basic parameters e.g. MHP, ATK, etc.

What about the extra parameters (e.g. HIT, EVA, CRI, MEV, MRF, CNT, HRG), special parameters (e.g. REC, PDR, MDR) and other traits (e.g. Element Rate, State Rate, State Resist, Attack Element, etc.)? If these aren't returned to the original your FROG state is overpowered. For example, if the enemy has immunities / high resists, this state will nuke them even after the state has ended which is certainly not what you're after.

Spoiler: Three Possible Scenarios
  1. FROG state meant for single or small number of enemies.
    Spoiler
    Why not just use Enemy Transformations as is and copy the original's stats and traits to the frog battler and 25% ATK added to the FROG state?
  2. FROG state meant for any enemy, transform() method used.
    Spoiler
    If you can somehow manually revert a single enemy's traits you will then need a very large conditional to account for all possible enemies that can be affected by the FROG state and all their possible traits that need to be reverted.
  3. FROG state meant for any enemy, another method used.
    Spoiler
    It's better if you can find another method that doesn't involve nuking a target's stats and traits and then reconstituting all of them. After all, without the transformation your FROG state is just a plain vanilla state where ATK is multiplied by 25%.

By the way, it seems someone had solved something similar to your MINI state. Change size with a state
As stated in this thread, I am underqualified to answer JavaScripting questions.

Regarding the OP FROG state, the intended end state was for the enemy to be transformed to a FROG to maintain ALL parameters/stats/etc. during the transformation. The only penalty was supposed to be -75% of their ATK parameter, all skills locked, and the apparent physical transformation to make it fun. Also, while FROGed, they can only ATTACK. While 99% of my bosses are immune to FROG, I see what you are saying, and now given that factor. I feel like I am back to square one. Ideally, I wanted just the enemy's appearance to change as the engine manually does the desired adverse status effects. I may end up researching a way to alter the appearance without changing one mob into another.

In regards to the MINI state, I will take a look at it ASAP and appreciate the assist.
Turan, I appreciate all of your time, assistance, and patience. For brevity's sake, anyone wishing to assist, please READ RESPONSE to Anastasius for the desired end state:

Regarding the OP FROG state, the intended end state was for the enemy to be transformed to a FROG to maintain ALL parameters/stats/etc. during the transformation. The only penalty was supposed to be -75% of their ATK parameter, all skills locked, and the apparent physical transformation to make it fun. Also, while FROGed, they can only ATTACK. While 99% of my bosses are immune to FROG, I see what you are saying, and now given that factor. I feel like I am back to square one. Ideally, I wanted just the enemy's appearance to change as the engine manually does the desired adverse status effects. I may end up researching a way to alter the appearance without changing one mob into another.

Please see the current script below as it stands; the current issue is when the enemy reverts to normal, its HP multiplies by x10 (changing from 999,999 to 10,000,000). The follow-on issue, it may/may not keep its original parameters, i.e., elemental properties, etc.:

JavaScript:
<Custom Apply Effect>
if (user.isEnemy()) {
  user._prevEnemyId = user._enemyId;
  user._origParams=user.enemy().params;
  user._origHp=user.hp;
  var transformEnemyId = 247;
  user.transform(transformEnemyId);
  for (var i=0; i<user._origParams.length; i++)
        user._paramPlus[i]=user._origParams[i]-user.param(i);
  user.refresh();
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) {
  user._origHp=user.hp;
  var transformEnemyId = user._prevEnemyId;
  user.transform(transformEnemyId);
  user._prevEnemyId = undefined;
  user.hp=user._origHp;
  user._paramPlus.forEach(x => x=0);
  user.refresh();
}
</Custom Remove Effect>
@jcmtexas01 If you're looking to have a state that can change the actor's image while it's active, try these notetags:
Spoiler: Custom Apply Effect
JavaScript:
<Custom Apply Effect>
user._originalSprite = user._battlerName || '';
user._battlerName = '4_2';
user.refresh();
</Custom Apply Effect>

Spoiler: Custom Remove Effect
JavaScript:
<Custom Remove Effect>
user._battlerName = user._originalSprite;
user.refresh();
</Custom Remove Effect>

In the Custom Apply Effect, change '4_2' to the file name of the sideview sprite you'd like to display while the actor is affected with the state.

The Custom Remove Effect will return the character back to their original sprite.

You should be able to do all the other effects you outlined, through the state traits directly through the editor.
@jcmtexas01
I don't use the plugin so I don't know if this will actually work for your FROG state. The guys in the thread claimed in worked for them.

Edit:
I made a plugin for you @jcmtexas01 . By default _battlerName only exists for actors. This plugin allows that property to be used for enemies as well.

Place the attached plugin at the very end of your plugins that affect enemy sprites then turn it ON. I successfully tested it on my device but you may have compatibility issues depending on your plugins list so this is not guaranteed to work. Worth a shot if you're out of ideas.

Spoiler: FROG State YEP Buffs and States Core Notetag
After you installed the attached plugin change 'frogSprite' to whatever you named your enemy frog sprite battler. Put that image file inside img\sv_enemies.

I borrowed terminology from ThreeSixNine above and adapted his code to work with enemies. Just copy and paste the code below into your FROG state notetag.

JavaScript:
<Custom Apply Effect>
user._originalSprite = user.enemy().battlerName;
user._battlerName = 'frogSprite';
</Custom Apply Effect>

<Custom Remove Effect>
user._battlerName = user._originalSprite;
user._originalSprite = undefined;
</Custom Remove Effect>

Don't forget that this will only modify the enemy sprite. Everything else stays the same so you have to modify those state traits on your own.
@Anastasius Thank you for adding this. I definitely forgot to check this on an enemy...
@jcmtexas01
I don't use the plugin so I don't know if this will actually work for your FROG state. The guys in the thread claimed in worked for them.

Edit:
I made a plugin for you @jcmtexas01 . By default _battlerName only exists for actors. This plugin allows that property to be used for enemies as well.

Place the attached plugin at the very end of your plugins that affect enemy sprites then turn it ON. I successfully tested it on my device but you may have compatibility issues depending on your plugins list so this is not guaranteed to work. Worth a shot if you're out of ideas.

Spoiler: FROG State YEP Buffs and States Core Notetag
After you installed the attached plugin change 'frogSprite' to whatever you named your enemy frog sprite battler. Put that image file inside img\sv_enemies.

I borrowed terminology from ThreeSixNine above and adapted his code to work with enemies. Just copy and paste the code below into your FROG state notetag.

JavaScript:
<Custom Apply Effect>
user._originalSprite = user.enemy().battlerName;
user._battlerName = 'frogSprite';
</Custom Apply Effect>

<Custom Remove Effect>
user._battlerName = user._originalSprite;
user._originalSprite = undefined;
</Custom Remove Effect>

Don't forget that this will only modify the enemy sprite. Everything else stays the same so you have to modify those state traits on your own.
I greatly appreciate the plugin, but it just causes the enemy to vanish and not change into the Frog SV_Actor. I tried moving it around to different locations, which produced the same result.
@Anastasius Thank you for adding this. I definitely forgot to check this on an enemy...
This FROG code worked perfectly for the SV_Actor, but not the SV-enemies.

Edit:
The MiNI link provided did not work on SV_enemies.
I happened to run into a plugin that should make this entire thing much simpler, but the creator is known for his plugins not playing nice with Yanfly stuff, so if you have any of them, there could be issues. Still, here's the link in case you want to try.

I remember running into an issue with yanfly Sideview battler plugin and CGMV Encyclopedia, where the encyclopedia wasn't showing the enemy sprite when you checked its entry.

Let me check how I fixed that and I'll get back to you. It will probably help me figure a solution for you.
I greatly appreciate the plugin, but it just causes the enemy to vanish and not change into the Frog SV_Actor. I tried moving it around to different locations, which produced the same result.
😐Can you show your plugin list? Since it worked on my device but not yours you might be having plugin conflicts.
Edit:
The MiNI link provided did not work on SV_enemies.
That's odd. The MINI state linked plugin was created by @caethyril who is highly reputable not only in this forum but also in other RPGM fora such as Steam.
I suspect plugin installation order or incompatibility issues on your end.

You should try Victor's plugin as @Sword_of_Dusk suggested. But note that as he'd mentioned in his post Victor's plugins are frequently incompatible with Yanfly's.

Edit:
@jcmtexas01 I started a fresh project with just the following plugins installed in order:
  1. YEP_CoreEngine
  2. YEP_BattleEngineCore
  3. YEP_X_AnimatedSVEnemies
  4. JCM_ChangeEnemySprite
  5. YEP_BuffsStatesCore
No plugin parameters (if any) were modified at all. @ThreeSixNine's code works perfectly for actors while mine works for enemies. The enemy sideview battler image is stored inside img\sv_enemies.

I created a new skill by copying and pasting the Guard skill and replaced the applied state with the FROG state. Instead of 'frogSprite' I replaced that with 'Rat'. I gave the Hero class this FROG skill and had Harold as the only member in the party.

Started a battle and tested the Bat enemy. A Turn 0 Troop event puts it to sleep. Then Harold applies the FROG skill. The Bat changed into a Rat during the FROG state duration. Then it changed back later.

So I think it's a plugin conflict on your end.
😐Can you show your plugin list? Since it worked on my device but not yours you might be having plugin conflicts.

That's odd. The MINI state linked plugin was created by @caethyril who is highly reputable not only in this forum but also in other RPGM fora such as Steam.
I suspect plugin installation order or incompatibility issues on your end.

You should try Victor's plugin as @Sword_of_Dusk suggested. But note that as he'd mentioned in his post Victor's plugins are frequently incompatible with Yanfly's.
You might be correct. Unfortunately, relying heavily on YEP plugins, Victor's never seems to work for me, given that fact. However, I can give it a shot.

Also, it has proven challenging to get plugin orders correct in general. Most plugin creators do not list their preferred order like Yanfly does on their site, and of course, there is no standing plugin order for plugins by multiple creators that I am aware of.

I wish someone would have designed a plugin order checker similar to the one Aloeguvner created for YEP plugins which provides the ideal order; accept one that assesses ALL plugins regardless of who created them. Since the creation of MZ, I doubt that will ever happen...

EDIT:
Added the error generated once the FROG spell turns the enemy invisible and My Plugins.
You might be correct. Unfortunately, relying heavily on YEP plugins, Victor's never seems to work for me, given that fact. However, I can give it a shot.
Well, I never used Victor's plugins either because I'm a Yanfly fan as well. 😤
EDIT:
Added the error generated once the FROG spell turns the enemy invisible and My Plugins.
Thank you! 😢That mean's there's no Frog.png file inside your img/sv_enemies folder.
Can you show a screenshot of your FROG state notetags where you used my code?

By the way, caethyril's plugin works perfectly in my fresh project.

EDIT 1:
If you've got time I can help you all night until we get both your FROG and MINI state to work. 😅
Don't worry, since your FROG and MINI states work fine in a fresh project it means this is just a matter of time before we fix this. 👋

EDIT 2:
If we manage to figure out the incompatibility issues this will be finished. The MINI state thanks to caethyril's plugin will work for both actors and enemies. Since you already said ThreeSixNine's FROG state for actors works perfectly we'll combine that with my extension to enemies and you're done.
Are you using animated Sideview battlers by Yanfly?
Hi @ThreeSixNine. Are you referring to me or to @jcmtexas01 ?
For my part I am using YEP_X_AnimatedSVEnemies. The FROG and MINI states are working fine when tested on a new project.

Original thread: https://forums.rpgmakerweb.com/threads/yep-buffs-states-core-mini-frog-states-assistance.144189/