A few questions about how to make certain skill effects.

Hey there, everyone. Here's another thread full of dumb questions from yours truly 😛

So I have some ideas for skills... only problem is... I'm not entirely sure what I need to do in order to make them do the intended effects. So... hopefully you guys can help me out! You don't have to answer each one, even just one or two would be a big help!

1. Is there a way to make a skill have a different effect depending on which actor is using it? For example, Actor A and Actor B can both cast the Fire spell, but Actor A is specialized in using offensive magic, while Actor B is not, so when Actor A casts Fire, it deals an additional 20% damage if the enemy is weak to that skill's element, while Actor B does not receive that effect. So is there any way to have the game check for the chosen added effect based on the Actor/Class using the skill? Also, before anyone asks, yes, it must be the *same skill*, due to the way my game's skill learning system is set up. I can't have different skills with similar effects per actor, every instance of the Fire spell for example must occupy the same slot in the skill list.

2. I actually need to know how to do the above example lol. How can I make a skill that does 20% more damage than the base damage rate if the enemy is weak to the skill's element? I mean, I know you can make an enemy weak to an element in their own Traits box, but I *also* want the skill itself to add 20% more damage when targeting weaknesses on top of that. So for example, if an enemy had 200% element rate weakness for Fire, it'd do 220% damage when using that particular skill. If it helps, I *do* have the VisuStella SkillsStatesCore.

3. Also related to question 1, how can I make a skill which, when used by certain actors/classes, grants additional state, buff and debuff duration? For example, if Actor B were to cast a Defense Debuff on an enemy, it would persist for 7 turns, rather than the typical 5 turns. Also, if Actor B were to cast the Sleep spell on the opponent, the Sleep state would persist for 5 turns rather than the usual 3. Additionally, if Actor B casts Sleep on the opponent, he would have an extra 10% success rate compared to other actors/classes using the spell. How could I achieve effects like this?

4. How can I make a skill apply a different state based on the actor/class using it? For example, I want to have a state that gives you reduced enemy encounter rate for 200 steps, but if Actor C for example uses it, then it lasts for 300 steps. So I think for this kind of thing, making two separate states and just making the skill apply a different one based on the actor/class would work, yeah?

5. Okay, normal skill questions now lol. How can I make a skill which makes the party instantly flee from battle with 100% chance, and also make it so that you're unable to use the skill in certain battles (such as boss battles).

6. How can I make a skill which transfers MP from one actor to another actor?

7. How can I make a skill which expends all of the user's current MP to cast, and then deals damage based on how much MP was consumed?

8. This is more about a state than a skill itself. How can I make a state that *increases* the enemy encounter rate? The database has options to decrease or eliminate encounters, but I don't see an option to increase it.

9. Okay so, for the next few questions, I THINK I know what to do... but I just want to confirm that these are correct before I start actually making them. And if they wouldn't work, or if there's a better way to do it, please let me know! First off, a Teleport spell, which allows you to return to previously visited locations.

I *think* that the way to achieve this is to make a Hidden Item that is added to your inventory when you first visit a given location, and make this item have the name of the location - for example, we'll call this town/item Firsttown. Then I would need to have the Teleport skill first check if Teleport is allowed to be used in the current location (via a switch), and if it is, then it opens the Select Item menu, which will display a list of each of the places you've visited via the Hidden Items that were added to the inventory upon visiting those locations for the first time. You then select the place you want to go, in this case, Firsttown, and then I would make a little teleporting animation, fade out the screen, transfer to Firsttown, and then fade in the screen. That would work, right?

10. I want to make a skill called Evacuate, which allows you to instantly exit from a dungeon, like an Escape Rope from Pokemon or the Evac spell in Dragon Quest. I THINK the way to achieve this is that upon entering a dungeon, I would store the map ID in a variable, and then if I cast Evacuate, it would first check to see if Evacuate is valid to be used in the current location (via a switch), and then it would display a little animation, then run a transfer event to take you to a specific location based on the map ID that is stored in the variable - which would be the entrance of whatever dungeon that the map ID corresponds to. Is that correct?

11. I want to make a skill which will tell the player how many unopened treasure chests exist on the current map. I THINK what I need to do is have the skill first store the map ID in a variable, and then have it go down a list of conditional branches, consisting of every map ID in the game, until it finds the map ID that matches the variable. Then, there would be a separate variable for each map which stores how many chests are in a given map, and each time that you open one of the chests on that map, that variable is decreased by 1. So the skill will then display a message saying something like "There are X chests still remaining in this area.", displaying the resulting value of that variable. Though this almost sounds... excessive? I feel like there may be an easier way to achieve this... so is this right, or is there a better way?

And... I think that's all my questions for the moment!
1. When entering battle, have an event check which characters have the skill, and then swap out that skill with an altered version that looks the same as the normal skill. Then, after battle, run an event to swap back to the normal skill.

2. A bit more work, but you can just manually apply an element state to enemies to act like a check, at the start of battle. Then have this in the damage formula, with x being the element state as weakness:

"if (b.isStateAffected(x)) (basic damage formula goes here)*1.2;} else {basic damage formula goes here}"

3. Pretty much the same as 1, but check each character for their class at the start of battle.

4. Same as above.

5. Add special effect 'Escape' to the skill (not sure if that makes it work 100%), otherwise, link it to a common event with an Abort Battle command. During special encounters, apply a state with a skill seal to disable that skill on all actors.

6. Link the skill to a common event that checks how much MP the user has and store the value in a variable (best way is to check the user is to create a separate version for each character and swap it in combat according to method 1, if it's a skill that can be used by everyone). Then, check for the target of the skill (have the skill apply an invisible state which will act like a check) and then add MP equal to the value in the variable, and remove MP from the user. Afterwards, remove the invisible state.

7. Just add '*a.mp' in the damage formula or do whatever with the damage formula, depending on how much bonus damage it needs to deal. Link the skill to an event and have it drain all MP from the user.

8. Don't know. Probably doesn't exist.

9. I would suggest to just experiment. You'll learn more from that than asking for confirmations from people. There's many different ways of making a teleport system like this.

10. There are so many ways to do this, none of them very difficult to achieve. Use one that works for you.

11. Just store the total number of chests on a map in a variable (make sure to count correctly...) and lower that number by 1 each time the player opens a chest on that map. Skill descriptions can display variables with '\v[x]', x being the number of the variable. Like, if using variable 11 for it, it should be written like:

Total number of unopened chests in the area: \v[11].
Most of what you ask is not only impossible in default, but also rather difficult to do even with general plugins. it can very well be that you'll need a custom plugin programmed specifically for you.

Especially your requirement that they have to be the same skills is very bad - and illogical in my opinion. The engine has several ways to hide the fact that different actors are using different skills of the same name, and because of that this is the preferred method for handling things.
unless you give more details why that isn't possible for you things will remain difficult for you.

and in your second example I think you focused too much on percentages instead of numbers, resulting in some confusion. Percentages of what exactly?
Almost all of this can be done using a single formula and a few other tweaks here and there... I have my whole explanation set in this code since I was pressed for time.

Code:
Game_Battler.prototype.sampleAttack= function(a, b) {
    if (a.isActor()) { // actor formula section
        if (a._actorId === 1) {
            // Will execute code here based on Actor ID, allowing actors to call same skill and have completely different effects/formula
            // Question 1, Question 3, Question 4
        }
        if (a._classId === 1) {
            // Will execute code here based on Class ID, allowing classes to call same skill and have completely different effects/formula
            // Question 1, Question 3, Question 4
        }
        if (b.meta.weakness === "fire") {
            // will check an enemy notbox for a weakness tag <weakness:fire> and then you can add more to the formula from here
            // (asking for +20% damage if weak to an element on top of normal weakness calculation.)
            // Question 2
        }
        if ($gameSwitches.value(id) === false) {
            BattleManager.abort() // Will force the battle to end/escape as long as the switch ID is false, just turn on that ID to TRUE before a battle you want to lock escaping from
            // Question 5
        }
        
        a._mp -= 100; b._mp += 100 // Takes 100 MP away from the user and gives 100 to the target. Question 6
        
        value = a._mp * (formula) // Checks current MP of user and multiplies it by the damage formula
        a._mp -= a._mp            // Drains all remaining MP from the user
        return value              // this is the damage the skill will do when finished. Question 7
        
        // Question 8 cannot be done without modifying how Encounters are handled in rmmz_objects.js
        
        // Question 9 - Call a common event and use Switches along with standard choice boxes is the easiest method,
        //  but your idea will work using the Key Item selection and warping based on choice made
        
        // Question 10 - I used something like this in my own game. When you enter an indoor area set a variable (I call mine Exit Area ID) and when you use the skill
        //  call a common event and have it check the current map ID (another variable) and then depending on which Exit Area ID you have set make it teleport the
        //  player to that door or previous map exit (has to manually be done). This comes in handy in case you have a lot of entries/exits to the same area/map.
        //  (example: a mountain map and a cave map with many entrances and exits so you know what door/entry point to teleport the player to.)
        
        // Question 11 - another common event situation where you will need to make each chest on a specific screen give -1 to a variable, either set on 1st map entry
        //  or at game start (Area 1 chests set to 10, each chest opened will reduce this variable by 1). Use the Skill and call the common event and have it make a message
        //  based on the Map ID "There are <variable> chests remaining here in <area 1>"
    }
    else {
        // Enemy formula section, allowing the enemy to use the same skill as the player and be different from the player formula/effects
        // Wasnt asked for, but tossed it here just in case :p
    }
}



I gave examples of how each one could be used and tagged each section as to what question it could pertain to.

You would call this function (saved to a .js file and placed close to the top of your plugin list) by putting "a.sampleAttack(a, b)" in your formula box

if needed I can go into more detail later when real life isn't nipping at my heels.
Hey,

I don't know how your skill learning system is set up, but usually one way to give different actors different variants of a skill would be to teach each actor every variant, but have the skill types decide which actor gets to see which variant. (For example, if Harold is the only actor with access to the "Harold" skill type, he will be the only one who will be able to use "Harold" type skills, no matter who else learns them)

I'm also pretty sure there was a exhaustive thread about stuff you can put in your damage formulas somewhere here, which might be useful to dig up.

Apart from that:

1 + 2)
You can check a battlers element rate in the damage formula itself if needed:
b.elementRate(17) (=> 17 = Elements database ID, 1.0 equals 100% effectiveness in the result)

Adding 20% base damage could then look like this for example (a straight multiplier would be a bit less complex than percentage base damage here):
(original formula) * (b.elementRate(2) > 1 ? (b.elementRate(2) + 0.2) / b.elementRate(2) : 1)

If you only want a specific actor (actor 1 here) to benefit from this bonus you can add an additional check to the condition:
(original formula) * (a === $gameActors.actor(1) && b.elementRate(2) > 1 ? (b.elementRate(2) + 0.2) / b.elementRate(2) : 1)

If these formulas are getting to long you can also move them into a plugin text file as in Ahuramazdas suggestion.
Instead of explicitely checking whether the user equals actor 1, you can of course also check for a specific feature to make the formula more flexible.


3 + 4)
Adding different states is a lot easier based on the target than the user of course (since you can make each target immune to all but one specific variant of a state and have the skill apply them all).
You can use plugins like VisuStellas Battle Core (or simply the damage formula*) to script custom effects into your skill:

Example for a note-tag that applies a 7 turn defense debuff to the target if the skill is used by actor 1, or a 5 turn defense debuff otherwise, using the Battle Core plugin:
Code:
<JS Post-Apply>
if (b.result().isHit()) {

  if (a === $gameActors.actor(1)) {
    b.addDebuff(3, 7);
  } else {
    b.addDebuff(3, 5);
  }

}
</JS Post-Apply>


8)
As others have said, you probably have to script that feature in. The encounter progress is calculated in the function
Game_Player.prototype.encounterProgressValue (rmmz_objects.js, line 8534ff.)

In order to make a encounter rate increase you can copy that function into a new plugin and modify it there (the definition in your plugin will take precedence over the default one).


---

* I personally prefer the BattleCore over using the damage formula for effects: for one because it makes the formula more clear (and allows for effects without using a damage formula at all), and using the damage formula breaks the "Autobattle" trait and possible plugin functions like a damage preview. Yanfly has made an in depth blog about this on their website. However, the damage formula is readily available and usually unproblematic to use for this, so I won't fault anyone for not following that recommendation. 🙂[/code]
Leaving this here, as a lot of what you asked can be accomplished this way:

using the damage formula breaks the "Autobattle" trait and possible plugin functions like a damage preview
That's not entirely and automatically true. For something like the first request to do more fire damage with a given actor, that wouldn't have any effect on Autobattle at all. It only breaks if what you're doing has non-end result effects - changing variables, adding/removing states, combining damage and healing at the same time, stuff like that.

I'm not saying you're wrong to have provided the warning, just putting out the clarification that it's not some terrible thing to have some advanced functionality in the damage formula 😉
Oh wow, this is a lot to unpack! I didn't think this would get so many replies so quickly!

Okay so first of all, since the question keeps coming up a lot... The reason why all of my characters have to learn the exact same skill is due to how I have skill learning set up. So first of all, there's only ONE skill category (Magic), because I wanted every single spell to be dumped into one single category, so that every character has the same (short) battle menu consisting of only Attack, Magic, Defend and Item, and so that even if a character can use 2 or 3 different "types" of spells, they all fall under the same category in the skill menu.

Second of all, the way you learn skills (for all but 2 characters) is to buy spellbook items and use them on your party members. Because of the way I have skill categories set up, I had to ask for a plugin that would prevent you from using these items on characters that shouldn't know those skills (Which @ATT_Turan thankfully helped out with! 😀), but now skill learning seems to work as intended.

Though.... hmmm... now as I'm sitting here typing this and thinking about it... do they REALLY have to be the same skill....? Wouldn't there be some way to make the spellbook items check which actor the item is being used on, and then teach them their version of the skill? I mean, I don't know how I would do that... but isn't that a possibility? The problem is that there can be only ONE of each spellbook, and they have to be able to teach every applicable actor that skill. So if we have a Fire Book, that item needs to be able to teach the Fire spell to Actors A, B and D, but not Actor C. I don't want to have 3 different Fire Book items for 3 different, specific actors, y'know? But yeah, this all makes me think that maybe I've been going about this the wrong way...

Okay so... a lot to reply to here...



1. When entering battle, have an event check which characters have the skill, and then swap out that skill with an altered version that looks the same as the normal skill. Then, after battle, run an event to swap back to the normal skill.

2. A bit more work, but you can just manually apply an element state to enemies to act like a check, at the start of battle. Then have this in the damage formula, with x being the element state as weakness:

"if (b.isStateAffected(x)) (basic damage formula goes here)*1.2;} else {basic damage formula goes here}"

3. Pretty much the same as 1, but check each character for their class at the start of battle.

4. Same as above.

5. Add special effect 'Escape' to the skill (not sure if that makes it work 100%), otherwise, link it to a common event with an Abort Battle command. During special encounters, apply a state with a skill seal to disable that skill on all actors.

6. Link the skill to a common event that checks how much MP the user has and store the value in a variable (best way is to check the user is to create a separate version for each character and swap it in combat according to method 1, if it's a skill that can be used by everyone). Then, check for the target of the skill (have the skill apply an invisible state which will act like a check) and then add MP equal to the value in the variable, and remove MP from the user. Afterwards, remove the invisible state.

7. Just add '*a.mp' in the damage formula or do whatever with the damage formula, depending on how much bonus damage it needs to deal. Link the skill to an event and have it drain all MP from the user.

8. Don't know. Probably doesn't exist.

9. I would suggest to just experiment. You'll learn more from that than asking for confirmations from people. There's many different ways of making a teleport system like this.

10. There are so many ways to do this, none of them very difficult to achieve. Use one that works for you.

11. Just store the total number of chests on a map in a variable (make sure to count correctly...) and lower that number by 1 each time the player opens a chest on that map. Skill descriptions can display variables with '\v[x]', x being the number of the variable. Like, if using variable 11 for it, it should be written like:

Total number of unopened chests in the area: \v[11].

1. So basically I'd have to do that with every single skill, for every single battle?

2. I don't think I understand... how would an element state work as a check for that?

3 and 4. So... again, I'd have to do that for every single state, every single battle?

5. I thought the Escape command was only for enemies? Are you sure that'd work?

6. I... think I get it?

7. Mmk.

8. Yeah this one seems to be a bit of a problem...

9. So apparently my idea works, right?

10. And this'll work too, right?

11. It would need to be cast though... but couldn't casting it (outside of battle, obviously) just display a message box with the variable?

Most of what you ask is not only impossible in default, but also rather difficult to do even with general plugins. it can very well be that you'll need a custom plugin programmed specifically for you.

Especially your requirement that they have to be the same skills is very bad - and illogical in my opinion. The engine has several ways to hide the fact that different actors are using different skills of the same name, and because of that this is the preferred method for handling things.
unless you give more details why that isn't possible for you things will remain difficult for you.

and in your second example I think you focused too much on percentages instead of numbers, resulting in some confusion. Percentages of what exactly?

Well... maybe I've been doing my skills wrong? lol

What's wrong with percentages? 😮

Almost all of this can be done using a single formula and a few other tweaks here and there... I have my whole explanation set in this code since I was pressed for time.

Code:
Game_Battler.prototype.sampleAttack= function(a, b) {
    if (a.isActor()) { // actor formula section
        if (a._actorId === 1) {
            // Will execute code here based on Actor ID, allowing actors to call same skill and have completely different effects/formula
            // Question 1, Question 3, Question 4
        }
        if (a._classId === 1) {
            // Will execute code here based on Class ID, allowing classes to call same skill and have completely different effects/formula
            // Question 1, Question 3, Question 4
        }
        if (b.meta.weakness === "fire") {
            // will check an enemy notbox for a weakness tag <weakness:fire> and then you can add more to the formula from here
            // (asking for +20% damage if weak to an element on top of normal weakness calculation.)
            // Question 2
        }
        if ($gameSwitches.value(id) === false) {
            BattleManager.abort() // Will force the battle to end/escape as long as the switch ID is false, just turn on that ID to TRUE before a battle you want to lock escaping from
            // Question 5
        }
       
        a._mp -= 100; b._mp += 100 // Takes 100 MP away from the user and gives 100 to the target. Question 6
       
        value = a._mp * (formula) // Checks current MP of user and multiplies it by the damage formula
        a._mp -= a._mp            // Drains all remaining MP from the user
        return value              // this is the damage the skill will do when finished. Question 7
       
        // Question 8 cannot be done without modifying how Encounters are handled in rmmz_objects.js
       
        // Question 9 - Call a common event and use Switches along with standard choice boxes is the easiest method,
        //  but your idea will work using the Key Item selection and warping based on choice made
       
        // Question 10 - I used something like this in my own game. When you enter an indoor area set a variable (I call mine Exit Area ID) and when you use the skill
        //  call a common event and have it check the current map ID (another variable) and then depending on which Exit Area ID you have set make it teleport the
        //  player to that door or previous map exit (has to manually be done). This comes in handy in case you have a lot of entries/exits to the same area/map.
        //  (example: a mountain map and a cave map with many entrances and exits so you know what door/entry point to teleport the player to.)
       
        // Question 11 - another common event situation where you will need to make each chest on a specific screen give -1 to a variable, either set on 1st map entry
        //  or at game start (Area 1 chests set to 10, each chest opened will reduce this variable by 1). Use the Skill and call the common event and have it make a message
        //  based on the Map ID "There are <variable> chests remaining here in <area 1>"
    }
    else {
        // Enemy formula section, allowing the enemy to use the same skill as the player and be different from the player formula/effects
        // Wasnt asked for, but tossed it here just in case :p
    }
}



I gave examples of how each one could be used and tagged each section as to what question it could pertain to.

You would call this function (saved to a .js file and placed close to the top of your plugin list) by putting "a.sampleAttack(a, b)" in your formula box

if needed I can go into more detail later when real life isn't nipping at my heels.

This seems really useful! But... I'm not entirely sure how to actually apply most of this? Where do I put some of these things exactly? In the formula box somehow? Or with notetags somewhere?

Hey,

I don't know how your skill learning system is set up, but usually one way to give different actors different variants of a skill would be to teach each actor every variant, but have the skill types decide which actor gets to see which variant. (For example, if Harold is the only actor with access to the "Harold" skill type, he will be the only one who will be able to use "Harold" type skills, no matter who else learns them)

I'm also pretty sure there was a exhaustive thread about stuff you can put in your damage formulas somewhere here, which might be useful to dig up.

Apart from that:

1 + 2)
You can check a battlers element rate in the damage formula itself if needed:
b.elementRate(17) (=> 17 = Elements database ID, 1.0 equals 100% effectiveness in the result)

Adding 20% base damage could then look like this for example (a straight multiplier would be a bit less complex than percentage base damage here):
(original formula) * (b.elementRate(2) > 1 ? (b.elementRate(2) + 0.2) / b.elementRate(2) : 1)

If you only want a specific actor (actor 1 here) to benefit from this bonus you can add an additional check to the condition:
(original formula) * (a === $gameActors.actor(1) && b.elementRate(2) > 1 ? (b.elementRate(2) + 0.2) / b.elementRate(2) : 1)

If these formulas are getting to long you can also move them into a plugin text file as in Ahuramazdas suggestion.
Instead of explicitely checking whether the user equals actor 1, you can of course also check for a specific feature to make the formula more flexible.


3 + 4)
Adding different states is a lot easier based on the target than the user of course (since you can make each target immune to all but one specific variant of a state and have the skill apply them all).
You can use plugins like VisuStellas Battle Core (or simply the damage formula*) to script custom effects into your skill:

Example for a note-tag that applies a 7 turn defense debuff to the target if the skill is used by actor 1, or a 5 turn defense debuff otherwise, using the Battle Core plugin:
Code:
<JS Post-Apply>
if (b.result().isHit()) {

  if (a === $gameActors.actor(1)) {
    b.addDebuff(3, 7);
  } else {
    b.addDebuff(3, 5);
  }

}
</JS Post-Apply>


8)
As others have said, you probably have to script that feature in. The encounter progress is calculated in the function
Game_Player.prototype.encounterProgressValue (rmmz_objects.js, line 8534ff.)

In order to make a encounter rate increase you can copy that function into a new plugin and modify it there (the definition in your plugin will take precedence over the default one).


---

* I personally prefer the BattleCore over using the damage formula for effects: for one because it makes the formula more clear (and allows for effects without using a damage formula at all), and using the damage formula breaks the "Autobattle" trait and possible plugin functions like a damage preview. Yanfly has made an in depth blog about this on their website. However, the damage formula is readily available and usually unproblematic to use for this, so I won't fault anyone for not following that recommendation. 🙂[/code]

Since there seems to still be a lot of confusion about how my skill system works, lemme illustrate it with some screenshots.

Spoiler: Magic System Explanation
You obtain books like these, which can be used on an actor to learn a spell. There are 4 categories of spells - Offensive (Red), Supportive (Blue), Utility (Green) and Enemy Skills (Yellow) (Haven't come up with a good name for the latter category yet). All four of these spells go into a single Magic category, so that the book items can teach the spells to all applicable actors, and all spells will go into one single menu heading.

skills00.png



Everyone's command menu in battle looks like this. Everyone has that same "Magic" Skill category, but what each actor is allowed to learn is different. (Also skill descriptions, MP costs, etc are temporary in these images btw)
skills05.png


Luca here can learn any of the 3 primary types of magic, so she's very versatile (which makes sense, as she's the main character), however she doesn't get any special bonuses from using certain types of spells that other actors might.

skills01.png


Here, on Luca's status screen, you can see that it tells you precisely what kinds of magic and equipment she can use. She's also special in that she can equip any type of weapon, but that's not really important right now.

skills02.png


Genos here on the other hand can ONLY use offensive (red) magic, as he is a Wizard. So even though he has the same skill category as Luca and everyone else does, any blue or green spellbooks can't be used on him.

skills03.png


As you can see here, it shows that he can only use offensive magic, but because he is more specialized, the effectiveness of his offensive magic is increased compared to when any other party member uses it. (Or at least, that's what I'm trying to achieve here 😛)

skills04.png


However, other, less specialized characters, won't get those bonus effects, like Kuna here, who can use both offensive and supportive magic, but has overall worse stats than Genos, and has a different passive trait.
skills06.png


So... yeah... that's basically how it works. Though again, I'm kind of wondering if maybe I've been doing this whole thing the wrong way? lol

Anyway, back to your reply...

So first of all, it was mentioned before... but why are percentages such a problem?

What do you mean by the battle core overriding the damage formula? I have the battle core but... what, am I not supposed to be using the skill damage formula box? Is there something I should be doing from within battle core?

*Reads the linked article*

Ooooh... Okay... so... mechanics in the formula box is a bad idea lol. So... what now then? 😛

Leaving this here, as a lot of what you asked can be accomplished this way:


That's not entirely and automatically true. For something like the first request to do more fire damage with a given actor, that wouldn't have any effect on Autobattle at all. It only breaks if what you're doing has non-end result effects - changing variables, adding/removing states, combining damage and healing at the same time, stuff like that.

I'm not saying you're wrong to have provided the warning, just putting out the clarification that it's not some terrible thing to have some advanced functionality in the damage formula 😉

Thanks for the clarification!
Though.... hmmm... now as I'm sitting here typing this and thinking about it... do they REALLY have to be the same skill....? Wouldn't there be some way to make the spellbook items check which actor the item is being used on, and then teach them their version of the skill? I mean, I don't know how I would do that... but isn't that a possibility? The problem is that there can be only ONE of each spellbook, and they have to be able to teach every applicable actor that skill. So if we have a Fire Book, that item needs to be able to teach the Fire spell to Actors A, B and D, but not Actor C. I don't want to have 3 different Fire Book items for 3 different, specific actors, y'know? But yeah, this all makes me think that maybe I've been going about this the wrong way...
So, I was reading this and had a thought. I actually found a plugin a little while back that allowed me to restrict item usage to specific actors, something I had been looking for for a good minute. I use MV for my project (mostly), so I thought that maybe it wouldn't do you any good as you use MZ. But I opened up MZ and tried it out in a project with no plugins. . .and it works!

Now, as I said, this was in a project with no plugins, so I can't promise compatibility with any other plugins you use, but it's worth a shot. You can find the plugin here. Look for the post by the user "Kokonaugt". If all goes well, it will at least allow you to have one item for each spell.
Though.... hmmm... now as I'm sitting here typing this and thinking about it... do they REALLY have to be the same skill....? Wouldn't there be some way to make the spellbook items check which actor the item is being used on, and then teach them their version of the skill?
You could do that. I don't really see why you'd want to do that versus some minor conditionals or uses of states in addition to the skills - which is something I didn't see anyone mention, although I didn't read all of the posts exhaustively.

The VisuStella Skills and States Core lets you give actors passive states that are always present. That's a really easy way to say "This actor does 20% more damage with these skills" without modifying anything in the skill entry itself.
I mean, I don't know how I would do that
I said it before and here it is again: take a bit of a break from trying to implement your favorite dream game and do some more tutorials. This is moderately basic eventing logic that you keep saying you don't know how you'd do it. Not saying it to be mean, but your posts have a lot of "I don't know how" and "I don't understand this" - I really think you need to knuckle down on learning RPG Maker better before trying to accomplish so much advanced stuff.
1. So basically I'd have to do that with every single skill, for every single battle?
Yes. The every battle isn't as big a deal, you can copy and paste troop events or get a plugin to define troop events to be used in every single troop. But I don't think constantly swapping in and out of skills is a very efficient way to approach this, in several ways.
2. I don't think I understand... how would an element state work as a check for that?
He gave you a literal, exact example in his post. The damage formula thread I linked you to also had examples just like it. Which part do you not understand?
5. I thought the Escape command was only for enemies? Are you sure that'd work?
You are correct. Escape is for enemies and can cause undesired effects on actors - you should use the Abort Battle event command.
8. Yeah this one seems to be a bit of a problem...
I don't know if anyone has written a version specifically for MZ (have you Googled it?) but you could see if Yanfly's Lure & Repel is compatible via FOSSIL.
9. So apparently my idea works, right?

10. And this'll work too, right?
Sure. I agree that you should just do it and try it. You'll learn very quickly what works and how it works in the game without waiting for other people to respond to you.
11. I want to make a skill which will tell the player how many unopened treasure chests exist on the current map. I THINK what I need to do is have the skill first store the map ID in a variable, and then have it go down a list of conditional branches, consisting of every map ID in the game, until it finds the map ID that matches the variable. Then, there would be a separate variable for each map which stores how many chests are in a given map, and each time that you open one of the chests on that map, that variable is decreased by 1. So the skill will then display a message saying something like "There are X chests still remaining in this area.", displaying the resulting value of that variable. Though this almost sounds... excessive? I feel like there may be an easier way to achieve this... so is this right, or is there a better way?
That's actually the way you'd do it with pure eventing. You could do it a lot more efficiently with a few JavaScript lines, and I or someone else can help you with that if you ask, but I think it's good practice for you to actually make the event.
What's wrong with percentages?
If you read what Andar said, I don't think he said there is a problem with percentages, period. For what it's worth, I'm pretty sure the damage formula thread I linked you to also explains how you can reference the target's elemental traits.

So first of all, it was mentioned before... but why are percentages such a problem?
I still don't see what you read that said percentages are a problem.
Ooooh... Okay... so... mechanics in the formula box is a bad idea lol. So... what now then?
No, some things in the damage formula are a bad idea depending on the rest of your game.

If you read the instructions for the plugin that poster suggested, you'll see there are many notetags that allow you to run code at different times during skills to modify damage and achieve other things. They do, however, require you to know how to do it in JavaScript.
What's wrong with percentages?
nothing is wrong with percentages as such - my comment was because I think you mixed up your numbers and were partially looking at the wrong base for those percentages.
It goes down to a similar reason as to why I wrote that what you want is impossible - IF you take into account your requirement to use the same skill.
if you check the other answers, almost everyone who did provide a solution had that include multiple skills swapped or similar tricks.

or as I told a lot of people over the decades: take two steps back and explain what you want (as it seem to be to the player), not how you want to do something unknown (as in using specific code or ways that may or may not fit).
do not focus on using a specific mechanic to achieve your goal, but if you can think of different ways to get there before choosing one.

This is especially important for new users that do not yet know all possible tricks of the engine.
1. So basically I'd have to do that with every single skill, for every single battle?

2. I don't think I understand... how would an element state work as a check for that?

3 and 4. So... again, I'd have to do that for every single state, every single battle?

5. I thought the Escape command was only for enemies? Are you sure that'd work?

6. I... think I get it?

7. Mmk.

8. Yeah this one seems to be a bit of a problem...

9. So apparently my idea works, right?

10. And this'll work too, right?

11. It would need to be cast though... but couldn't casting it (outside of battle, obviously) just display a message box with the variable?

1. Only for the ones that have different effects, based on the character/class using them. If that happens with all skills, then yes, every single skill.

2. Because the damage formula checks whether the enemy is inflicted with that state and applies a different formula vs. when they're not inflicted by it. If not giving the state an icon, it's invisible to the player.

3-4. For every skill that has different effects, based on the character/class using them. And you use a Common Event for that, so all you do is copy/paste the start of battle page with a link to that Common Event on every battle encounter.

5. No idea, because I never use it myself. That's why I said to use Abort Battle otherwise. Experiment.

8. It would be easily doable by setting up a random encounter system with events, rather than the built-in one by RPG Maker. It would just take extra effort.

9-10. It would've taken less effort to just try and experiment those 2 in the program than typing out all that and then ask for confirmation a second time.

11. It doesn't need to be cast, but if you really want it to work like that, sure. It can work either way. Not sure why the confusion about this.
This seems really useful! But... I'm not entirely sure how to actually apply most of this? Where do I put some of these things exactly? In the formula box somehow? Or with notetags somewhere?
As I said in my post, you would save that as a .js file and put it into the plugin list in the game editor. And then you would call that specific formula using "a.sampleAttack(a, b)" in the spell formula box.

All of the editing of the formula and its effects would happen by editing the Javascript file itself, which acts as an infinite formula box where you can keep the flow much neater since you can use multiple lines of code and comments to remind you of what you're doing.

As some have pointed out there are certain effects you may want to avoid, esp if you're going to use auto battle for anything. If you have no plans for any form of auto-battles you can add anything to it you desire and have no ill side effects.
So, I was reading this and had a thought. I actually found a plugin a little while back that allowed me to restrict item usage to specific actors, something I had been looking for for a good minute. I use MV for my project (mostly), so I thought that maybe it wouldn't do you any good as you use MZ. But I opened up MZ and tried it out in a project with no plugins. . .and it works!

Now, as I said, this was in a project with no plugins, so I can't promise compatibility with any other plugins you use, but it's worth a shot. You can find the plugin here. Look for the post by the user "Kokonaugt". If all goes well, it will at least allow you to have one item for each spell.

Thanks, though I already have a plugin from @ATT_Turan that restricts the item usage to specific actors. The problem is that, if I wanted to use multiple versions of a skill (to more easily control what each actor can do with their skills), I think I would need for the item to be able to check which Actor that it is being used on, so that it knows which version of a skill to teach them. But I don't think that the Conditional Branch function can actually check which actor the item is being used on, only that the Actor is in the party and such. Would it be possible to get it to check for who it's being used on via the Script option in the Conditional Branch? If so, then I could just have it go down the list of valid actors when the item is used on them, and when it hits the correct actor in the branch, it adds their version of the skill to them.

You could do that. I don't really see why you'd want to do that versus some minor conditionals or uses of states in addition to the skills - which is something I didn't see anyone mention, although I didn't read all of the posts exhaustively.

The VisuStella Skills and States Core lets you give actors passive states that are always present. That's a really easy way to say "This actor does 20% more damage with these skills" without modifying anything in the skill entry itself.

I said it before and here it is again: take a bit of a break from trying to implement your favorite dream game and do some more tutorials. This is moderately basic eventing logic that you keep saying you don't know how you'd do it. Not saying it to be mean, but your posts have a lot of "I don't know how" and "I don't understand this" - I really think you need to knuckle down on learning RPG Maker better before trying to accomplish so much advanced stuff.

Yes. The every battle isn't as big a deal, you can copy and paste troop events or get a plugin to define troop events to be used in every single troop. But I don't think constantly swapping in and out of skills is a very efficient way to approach this, in several ways.

He gave you a literal, exact example in his post. The damage formula thread I linked you to also had examples just like it. Which part do you not understand?

You are correct. Escape is for enemies and can cause undesired effects on actors - you should use the Abort Battle event command.

I don't know if anyone has written a version specifically for MZ (have you Googled it?) but you could see if Yanfly's Lure & Repel is compatible via FOSSIL.

Sure. I agree that you should just do it and try it. You'll learn very quickly what works and how it works in the game without waiting for other people to respond to you.

That's actually the way you'd do it with pure eventing. You could do it a lot more efficiently with a few JavaScript lines, and I or someone else can help you with that if you ask, but I think it's good practice for you to actually make the event.

If you read what Andar said, I don't think he said there is a problem with percentages, period. For what it's worth, I'm pretty sure the damage formula thread I linked you to also explains how you can reference the target's elemental traits.


I still don't see what you read that said percentages are a problem.

No, some things in the damage formula are a bad idea depending on the rest of your game.

If you read the instructions for the plugin that poster suggested, you'll see there are many notetags that allow you to run code at different times during skills to modify damage and achieve other things. They do, however, require you to know how to do it in JavaScript.

Using passive states sounds like a good idea! Actually, this made me look deeper into the Skills and States Core, and I found something interesting!

<State id Turns: +x>

This would let me achieve at least one of the effects that I want... but... it only seems to apply to Skill and Item notetags, not Actors or States... I wonder if there's a workaround to make it work...

I don't see anything here though about increasing element damage based on weakness, or some other effects I want to achieve like making the Cleric have 200% effect when using healing spells (which doesn't appear to be the same thing as the Recovery Effect trait since that seems to apply to the Actors who has the trait and not other Actors whom they are healing) though. I don't think that this plugin can perform those effects?

Anyway, regarding tutorials, do you have any good resource suggestions that I should be reading up on? As for me not understanding things too well...
Spoiler
truth be told, I'm actually slightly autistic, so I'm just a liiiittle bit slow. Plus I'm exceptionally bad at math and know -all about coding lol. I don't really want people to treat me different because of the whole autism thing though, but I just hope people understand that I might be a teeny bit slow on the uptake sometimes.

Sorry, poor choice of words lol. So I get what the formula means, but I don't understand how that actually produces the intended effect? So if I'm understanding what he suggested, I would apply a state to an *enemy* to factor in the element rate? But... how would the enemy get the state? As I read what he said again however... wouldn't that formula work if the *Actor* had that state as a passive state?

I actually saw that, about Yanfly's Lure and Repel, but... I also saw a thing that said you weren't allowed to use Yanfly's scripts with FOSSIL because of some rules that VisuStella has, because they want to charge people more for their new MZ plugins. Is that not the case?

Also, I was thinking last night that maybe I'll just do it like Dragon Quest's Whistle skill, which instead of trying to modify the encounter rate, I could just cause the skill to run a common event to instantly trigger a random battle based on the area's normal encounters. Seems like it'd be more convenient for the player too.

Right, I get it now with the percentages and autobattle and stuff. It was just a little confusing at first. Plus when I responded to those messages last night I was really tired so I don't think I read through everything correctly at the time lol.

Yeah, and I don't know aaaanything about Javascript lol

Sorry if I'm being annoying with all my dumb questions and lack of understanding >_<

nothing is wrong with percentages as such - my comment was because I think you mixed up your numbers and were partially looking at the wrong base for those percentages.
It goes down to a similar reason as to why I wrote that what you want is impossible - IF you take into account your requirement to use the same skill.
if you check the other answers, almost everyone who did provide a solution had that include multiple skills swapped or similar tricks.

or as I told a lot of people over the decades: take two steps back and explain what you want (as it seem to be to the player), not how you want to do something unknown (as in using specific code or ways that may or may not fit).
do not focus on using a specific mechanic to achieve your goal, but if you can think of different ways to get there before choosing one.

This is especially important for new users that do not yet know all possible tricks of the engine.

Makes sense! I guess I just assumed this was how I had to do all these things, but never really considered that there may be other, better ways to go about it.

1. Only for the ones that have different effects, based on the character/class using them. If that happens with all skills, then yes, every single skill.

2. Because the damage formula checks whether the enemy is inflicted with that state and applies a different formula vs. when they're not inflicted by it. If not giving the state an icon, it's invisible to the player.

3-4. For every skill that has different effects, based on the character/class using them. And you use a Common Event for that, so all you do is copy/paste the start of battle page with a link to that Common Event on every battle encounter.

5. No idea, because I never use it myself. That's why I said to use Abort Battle otherwise. Experiment.

8. It would be easily doable by setting up a random encounter system with events, rather than the built-in one by RPG Maker. It would just take extra effort.

9-10. It would've taken less effort to just try and experiment those 2 in the program than typing out all that and then ask for confirmation a second time.

11. It doesn't need to be cast, but if you really want it to work like that, sure. It can work either way. Not sure why the confusion about this.

1. Gotcha.

2. Right, but like I said above... how does the enemy get the state...? Plus I don't want the enemy to inherently be weaker than normal to an element, I just want that particular Actor to be more effective when hitting weaknesses. So it should be a state on the Actor, not the enemies, right?

3-4. Oh yeah, makes sense. I think Battle Core might actually have a thing to run a troop event in every single troop as well.

5. I shall try that!

8. Maybe just duplicating DQ's Whistle skill would be the best bet after all lol

9-10. True lol.

11. I think I was just overcomplicating it in my head and it really was that simple 😛

As I said in my post, you would save that as a .js file and put it into the plugin list in the game editor. And then you would call that specific formula using "a.sampleAttack(a, b)" in the spell formula box.

All of the editing of the formula and its effects would happen by editing the Javascript file itself, which acts as an infinite formula box where you can keep the flow much neater since you can use multiple lines of code and comments to remind you of what you're doing.

As some have pointed out there are certain effects you may want to avoid, esp if you're going to use auto battle for anything. If you have no plans for any form of auto-battles you can add anything to it you desire and have no ill side effects.

I actually do plan to use auto battle. I'm gonna use the auto battle option that's available through the Battle Core, and I also have Confuse and Charm states, which... does that count as auto battle? Or is that something different?

I don't know anything about writing lines of JS code though. Like, looking at all of that code you guys have posted, it's like I'm trying to read another language lol. It's cool if I can just replace an X with the values I need, but that's about as much as I can grasp with it.
11. It doesn't need to be cast,
If they wish to replicate DQ's Nose for Treasure spell, it actually will need to be cast on command.


Thanks, though I already have a plugin from @ATT_Turan that restricts the item usage to specific actors. The problem is that, if I wanted to use multiple versions of a skill (to more easily control what each actor can do with their skills), I think I would need for the item to be able to check which Actor that it is being used on, so that it knows which version of a skill to teach them. But I don't think that the Conditional Branch function can actually check which actor the item is being used on, only that the Actor is in the party and such. Would it be possible to get it to check for who it's being used on via the Script option in the Conditional Branch? If so, then I could just have it go down the list of valid actors when the item is used on them, and when it hits the correct actor in the branch, it adds their version of the skill to them.
I totally forgot that was what that plugin was for (I was in that topic at one point). My bad. As for the other issue here, yeah, you can. Use the following script call in a Conditional Branch: $gameParty._targetActorId === ID.
Change ID to the ID of whichever actor you're checking.



8. Maybe just duplicating DQ's Whistle skill would be the best bet after all lol
Did you go Google searching for your encounter rate problems? I found what looks to be exactly what you're looking for on a Steam post. It's a plugin from @caethyril.
2. Right, but like I said above... how does the enemy get the state...? Plus I don't want the enemy to inherently be weaker than normal to an element, I just want that particular Actor to be more effective when hitting weaknesses. So it should be a state on the Actor, not the enemies, right?

You apply it at the start of battle through an event command. The only downside is that you have to go through encounter that has enemies it should be applied to and then manually inflict it on them only with the event command. It's some extra work, depending on how many encounters you have and how many monsters it would apply to, but at the same time it's something you can get done without needing to rely on a plugin (which in my opinion is generally worth it, if the results are going to be the same and the effort required isn't an inhuman amount).

If they wish to replicate DQ's Nose for Treasure spell, it actually will need to be cast on command.

I wouldn't know, as I never played any of those games. But it seems silly to making the player cast it when the information can be given in the Skill's description without need of casting it. Saving time and clicks and all.
I wouldn't know, as I never played any of those games. But it seems silly to making the player cast it when the information can be given in the Skill's description without need of casting it. Saving time and clicks and all.
Never played a Dragon Quest game? If you have any sort of love for turn based RPGs, you should try one out.

And while you aren't wrong about the time saving aspect, in any DQ game with the spell, it's framed as the caster literally taking a sniff and knowing how much unclaimed treasure is left in an area. As such, they actually say this in a message box.
I don't see anything here though about increasing element damage based on weakness,
or some other effects I want to achieve like making the Cleric have 200% effect when using healing spells (which doesn't appear to be the same thing as the Recovery Effect
You would really simply put that in the Damage Formula as HP Recovery, using the information linked to you in the instructional thread the way up there.
Anyway, regarding tutorials, do you have any good resource suggestions that I should be reading up on?
Go to YouTube, watch and follow along with (make little games using what they're talking about) whatever you get from "RPG Maker MZ tutorial" or "RPG Maker MV tutorial" - they're almost identical when it comes to things like eventing logic, only the mapping interface and some of the code is different. Some that I commonly recommend are Echo607, SRDude, Driftwood Gaming.

You can also go to Yanfly's Tips & Tricks that I just linked to one of. Read through the list - you don't have to read the code for how to implement every one, but they give you a really good idea of effects that already have solutions for adding to your game.

So I get what the formula means, but I don't understand how that actually produces the intended effect? So if I'm understanding what he suggested, I would apply a state to an *enemy* to factor in the element rate? But... how would the enemy get the state?
Any way you want. Probably a troop event on turn 0 - again, that's a really basic bit of functionality in RPG Maker that people are going to expect you're familiar with when giving you answers.
As I read what he said again however... wouldn't that formula work if the *Actor* had that state as a passive state?
Not that exact formula, because b talks about the target of the attack. But yes, you could change one letter and make it refer to the attacker having a passive state (if you're using MV plugins, MZ has different code for checking for a passive state, which is in the instructions of the plugin).
I also saw a thing that said you weren't allowed to use Yanfly's scripts with FOSSIL because of some rules that VisuStella has, because they want to charge people more for their new MZ plugins. Is that not the case?
Absolutely not. I don't know where you saw that, but that makes no sense.
I don't know anything about writing lines of JS code though. Like, looking at all of that code you guys have posted, it's like I'm trying to read another language lol. It's cool if I can just replace an X with the values I need, but that's about as much as I can grasp with it.
The Damage Formula 101 thread that I linked above and keep referencing (you have clicked on it and read through its instructions by now, right?) provides everything already typed out, indicating where you need to insert a number.

So do pretty much any thread that you find if you Google "RPG Maker MZ this_topic script call" or search through the script call list that's pinned in the JavaScript forum.
If they wish to replicate DQ's Nose for Treasure spell, it actually will need to be cast on command.



I totally forgot that was what that plugin was for (I was in that topic at one point). My bad. As for the other issue here, yeah, you can. Use the following script call in a Conditional Branch: $gameParty._targetActorId === ID.
Change ID to the ID of whichever actor you're checking.




Did you go Google searching for your encounter rate problems? I found what looks to be exactly what you're looking for on a Steam post. It's a plugin from @caethyril.

Maybe that's just what I'll do then! I'll rework it so that each character does indeed have unique skills, and certain characters have better versions of those skills. Then I'll just make the skill-teaching items check for which actor it's being used on, and give them the appropriate skill!

And yes, I'm trying to replicate Nose for Treasure, more or less.

That doesn't seem to be what I want though. In fact, what that plugin seems to offer already comes with the VisuStella Options Core, which is to let the user choose the encounter rate from a menu, which is not the intended effect I'm looking for. Rather, I want the player to have to cast a spell which provides a state that adjusts the encounter rate to be higher. Though as I said above, maybe I'll just change it so that instead of it increasing encounter rate, the spell in question will just call a random encounter via common event.

You apply it at the start of battle through an event command. The only downside is that you have to go through encounter that has enemies it should be applied to and then manually inflict it on them only with the event command. It's some extra work, depending on how many encounters you have and how many monsters it would apply to, but at the same time it's something you can get done without needing to rely on a plugin (which in my opinion is generally worth it, if the results are going to be the same and the effort required isn't an inhuman amount).



I wouldn't know, as I never played any of those games. But it seems silly to making the player cast it when the information can be given in the Skill's description without need of casting it. Saving time and clicks and all.

Well, if I do indeed go with using unique skills per actor, then I don't really need to worry about that anymore, right?

Also, like someone else said, if you like turn based RPGs, you HAVE to play a DQ game! DQ11 is the newest one and it's excellent, and is a great way to get into the series.

And while that idea might work for some games... that's not really the kind of effect I'm going for. But I can always do it the old fashioned way 🙂


You would really simply put that in the Damage Formula as HP Recovery, using the information linked to you in the instructional thread the way up there.

Go to YouTube, watch and follow along with (make little games using what they're talking about) whatever you get from "RPG Maker MZ tutorial" or "RPG Maker MV tutorial" - they're almost identical when it comes to things like eventing logic, only the mapping interface and some of the code is different. Some that I commonly recommend are Echo607, SRDude, Driftwood Gaming.

You can also go to Yanfly's Tips & Tricks that I just linked to one of. Read through the list - you don't have to read the code for how to implement every one, but they give you a really good idea of effects that already have solutions for adding to your game.


Any way you want. Probably a troop event on turn 0 - again, that's a really basic bit of functionality in RPG Maker that people are going to expect you're familiar with when giving you answers.

Not that exact formula, because b talks about the target of the attack. But yes, you could change one letter and make it refer to the attacker having a passive state (if you're using MV plugins, MZ has different code for checking for a passive state, which is in the instructions of the plugin).

Absolutely not. I don't know where you saw that, but that makes no sense.

The Damage Formula 101 thread that I linked above and keep referencing (you have clicked on it and read through its instructions by now, right?) provides everything already typed out, indicating where you need to insert a number.

So do pretty much any thread that you find if you Google "RPG Maker MZ this_topic script call" or search through the script call list that's pinned in the JavaScript forum.

That Elemental Exposure thing sounds to me like if you hit an enemy's elemental weakness, it causes them to become more vulnerable to *all* damage, which isn't what I really want. Maybe what I'll just do instead, since I'm gonna be changing the skills to account for unique skills per actor, is just make the Wizard have 20% stronger spells overall. It's a lot simpler that way, no?

I'll definitely go and check out some of those tutorials! I guess I am trying to do a lot of complex stuff with this game (even though to the player, the game is going to be ridiculously simple, at least on the surface), though it's not like this is my first RPG Maker project or anything. I've worked with the engine for years, though I've only put out like one major project (and a little side project), so maybe I just assumed I knew more about what I was doing than I actually did 😛


That's what I was reading about Yanfly's plugins. It says that you can't port the plugins... but... I guess I stopped reading when I got to that part, because now that I read it all the way through, it says this:
"If you want to make edits to the Yanfly Engine Plugins so that they can be compatible for RPG Maker MZ, you can do it while still following the Terms of Use:

If you use the plugins in their current form, with all the credits and such attached, you can use them with edits. They will not be considered ports, but they will still be considered the original plugins. Redistribution of the edits outside of the scope of your game is forbidden as that conflicts with the Terms of Use."

So... FOSSIL is okay then, right?

Anyway, yeah, I shall examine that thread you linked in more detail then! 🙂
That doesn't seem to be what I want though. In fact, what that plugin seems to offer already comes with the VisuStella Options Core, which is to let the user choose the encounter rate from a menu, which is not the intended effect I'm looking for. Rather, I want the player to have to cast a spell which provides a state that adjusts the encounter rate to be higher. Though as I said above, maybe I'll just change it so that instead of it increasing encounter rate, the spell in question will just call a random encounter via common event.
If you don't want to give players the chance to set encounter rates by option, I would agree that replicating the Whistle skill is a better way to go.
So first of all, it was mentioned before... but why are percentages such a problem?
I didn't mean to say that it was a problem.
In this case, if you want your skill to deal 120% of its normal damage in "situation X", then you could express that in your skills damage formula with a relatively simple pattern:
(Original Formula) * (SituationX ? 1.2 : 1)

If you want your skill to deal extra damage in the amount of 20% of the skills base damage but without the targets elemental affinity (or maybe other modifiers) then the pattern would become more intricate as you'd have to calculate these effects out (as one possible solution):
(Original Formula) * (SituationX ? (ElementRate + 0.2) / ElementRate : 1)

It wasn't entirely clear to me from your opening post if you actually needed that extra complexity.

Instead of
b.elementRate(2) > 1
you can also use
this.calcElementRate(b) > 1
to check if the target is weak to the skills element. This alternative works without you having to enter the specific element again (in case your skill has multiple elements or if you want to apply the condition to different skills).

What do you mean by the battle core overriding the damage formula? I have the battle core but... what, am I not supposed to be using the skill damage formula box? Is there something I should be doing from within battle core?
If you look through the suggestions in the "Damage Formulas 101" thread ATT_Turan linked you'll find a lot of examples that use the damage formula for custom effects not (entirely) related to damage calculation. I was kind of tired when I wrote the footnote, but these were the kind of effects I meant.^^

Generally this works fine if you don't mind the extra code taking up space in the formula window (or if you use Ahuramazdas approach and move the code) and don't plan to make use of the Autobattle trait or plugins featuring a damage preview or elaborate enemy AI by relying on calculating the skills damage for evaluation.

The Battle Core example just provides an alternative space to put these effects in without cramping the formula window or disrupting eventual skill assessments if that is something you prefer.

I don't know if it is still relevant, but you should be able to add any of the skill effects with variable parameters using this pattern:
Code:
<JS Post-Apply>
if (b.result().isHit()) {
  let effect;
 
  effect = {};
  effect.code = Game_Action.EFFECT_GROW;
  effect.dataId = 0;
  effect.value1 = 15;
  effect.value2 = 0;
  this.applyItemEffect(b, effect);

}
</JS Post-Apply>
effect.code => You can find the possible skill effect codes in "rmmz_objects.js" in the /js folder of your project, line 1390-1402. You can use either the constants name or the assigned numerical value here:
Spoiler
Game_Action.EFFECT_RECOVER_HP = 11;
Game_Action.EFFECT_RECOVER_MP = 12;
Game_Action.EFFECT_GAIN_TP = 13;
Game_Action.EFFECT_ADD_STATE = 21;
Game_Action.EFFECT_REMOVE_STATE = 22;
Game_Action.EFFECT_ADD_BUFF = 31;
Game_Action.EFFECT_ADD_DEBUFF = 32;
Game_Action.EFFECT_REMOVE_BUFF = 33;
Game_Action.EFFECT_REMOVE_DEBUFF = 34;
Game_Action.EFFECT_SPECIAL = 41;
Game_Action.EFFECT_GROW = 42;
Game_Action.EFFECT_LEARN_SKILL = 43;
Game_Action.EFFECT_COMMON_EVENT = 44;
effect.dataId => The database ID of the operated entry, otherwise the position in the drop down menu (in these cases starting at index 0)
effect.value1 => The value of the numerical field (in case of a percentage: 1.0 equals 100%)
effect.value2 => The value of the second numerical field (only used for Recover HP/MP effects)
As this is in Javascript, you could go to any length to determine these values.

In this example, you have the skill effect for increasing MHP by 15. Value2 is not used for this particular effect and the line could be removed here.


The Battle Core also allows you to add these pre-apply, pre-damage, post-damage or post-apply effects to your actors directly with a slightly different notetag-name instead of a specific skill, in case you want an effect to apply to all skills that actor uses (as maybe an alternative to the Skills&States Core solution).

Original thread: https://forums.rpgmakerweb.com/threads/a-few-questions-about-how-to-make-certain-skill-effects.149890/