Is it possible to make enemy resistant to special effect?

I have made an actor skill which makes enemy escape if succeed. Thats the only purpose of the skill.

Database -> Skills and from there I have selected the skill which has only one effect typed as "Special effect" content: "Escape"

Is it possible to make enemy resistant to that skill? I have tried everything I can come up with. I tried to swich damage type from none to any from the list, so then I can change the element. Then I made the enemy resistant to that element, but it does not work.

One possibility is that you make the enemy appear on certain locations on the map via event, and not checking the "can escape" box. Then you cannot even perform the attack. But I think it would be much better, if the skill can be performed and the enemy is resistant.
Not by default and not directly

what you can do is install a plugin that allows for skill or target conditions and use javascript to program an exception by notetag.
There are several such plugins that would allow that, for example from yanfly and tsukihime (iirc).
do you have any of those plugins already?
Target effects apply whenever the action hits, regardless of damage.

Depending on exactly what you want to do, one of these workarounds might be OK:
  • You could set the skill's Success rate to, say, 70%. That would give it a constant 30% chance of failing on any target.

  • You could set the skill's Hit Type to Physical or Magical, and give the enemy high Evasion/Reflection for that hit type to reduce the hit chance for all actions of that type.
Otherwise, like Andar says, you'd want a suitable plugin.

Here's something untested, in case it helps:
Spoiler: plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc Adds <resist escape: X> notetag for trait objects.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/173071/
 * @help Actor/Enemy/Class/Weapon/Armor/State notetag:
 *        <resist escape: X>
 *   e.g. <resist escape: 80> = 80% escape resistance
 *
 * Free to use and/or modify for any project, no credit required.
 */
;void (function() => {
"use strict";
  /** Tag label. @type {string} */
  const TAG_NAME = "resist escape";

  /** Tag processing methods. */
  const tag = Object.freeze({

    /**
     * @param {object} o Trait object from which to parse tag data.
     * @returns {number} Tag value, or `0` if no tag.
     */
    parse: function(o) {
      if (o) {  // jic
        const v = parseInt(o.meta[TAG_NAME], 10);
        if (v)
          return v / 100;
      }
      return 0;
    },

    /**
     * Used with `Array#reduce`.
     * @param {number} a Value 1.
     * @param {number} c Value 2.
     * @param {number} [n] Index of value `c` in source array.
     * @returns {number} Combined value.
     */
    combine: function(a, c, n) {
      // return a + c;  // additive
      return 1 - (1 - a) * (1 - c);  // multiplicative
    },

    /**
     * @param {number[]} values Array of parsed tag values.
     * @returns {number} Final value.
     */
    reduce: function(values) {
      return values.reduce(tag.combine, 0);
    }

  });

  /**
   * @param {Game_Battler} battler Determine this battler's resistance.
   * @returns {number} Escape effect resistance for `battler`.
   */
  const getResistEscape = function(battler) {
    if (!battler)  // jic
      return 0;
    return tag.reduce(Array.from(
      battler.traitObjects(), tag.parse
    ));
  };

  // Patch - intercept Escape effect processing to apply resistance.
  void (alias => {
    Game_Action.prototype.itemEffectSpecial = function(target, effect) {
      if (effect.dataId === Game_Action.SPECIAL_EFFECT_ESCAPE) {
        if (Math.random() >= getResistEscape(target)) {
          target.escape();
          this.makeSuccess(target);
        }
      } else
        alias.apply(this, arguments);
    };
  })(Game_Action.prototype.itemEffectSpecial);

})();
addendum:

there is a way of making something like you want by default, I just thought of it

1) make a state that seals that specific skill
2) in the troop for the boss enemy, make a troop event on turn 0 that applies that state to every actor

doing it this way blocks the skill for that fight, which means against every enemy in that troop if there is more than the boss
but it is the only way to do this with selective enemies, and even then it's for the entire troop instead of a specific enemy.
Not by default and not directly

what you can do is install a plugin that allows for skill or target conditions and use javascript to program an exception by notetag.
There are several such plugins that would allow that, for example from yanfly and tsukihime (iirc).
do you have any of those plugins already?
Thanks for the answer Andar! I havent tried, I thought there would be some kind of possibility on the RPG Maker to do that resistance for enemy. I´ll have to consider the options. Maybe I´ll try plugin.
Target effects apply whenever the action hits, regardless of damage.

Depending on exactly what you want to do, one of these workarounds might be OK:
  • You could set the skill's Success rate to, say, 70%. That would give it a constant 30% chance of failing on any target.

  • You could set the skill's Hit Type to Physical or Magical, and give the enemy high Evasion/Reflection for that hit type to reduce the hit chance for all actions of that type.
Otherwise, like Andar says, you'd want a suitable plugin.
I´m just practicing with this RPG Maker, and I hope that someday this practicing leads to publishable game. I have already tried different succession rates, they work fine. The original skill does not include any hit, it just makes enemy to escape with low succession rate. It is just a skill with special effect...and as I already wrote I changed attack type and made enemy resistant to that hit type -> does not help with my case. The purpose of the skill is to make some of the enemies escape from battle with low succession rate, but in this game some enemies cannot be negotiated with.
addendum:

there is a way of making something like you want by default, I just thought of it

1) make a state that seals that specific skill
2) in the troop for the boss enemy, make a troop event on turn 0 that applies that state to every actor

doing it this way blocks the skill for that fight, which means against every enemy in that troop if there is more than the boss
but it is the only way to do this with selective enemies, and even then it's for the entire troop instead of a specific enemy.
Okay, thanks again. I´ll have to do some research or maybe you can give me more precise instruction? I did not get all of that 😀 I have only used RPG Maker for 100 hours, I´m very newbie with this.
Well, I suppose I'll throw in another way. If you're using Action Sequencing, you could also have a conditional branch that says if the target is not "Your specific enemy/s" , do the action effect. That would also work.
make a troop event on turn 0 that applies that state to every actor
Sounds good! By default death removes all other states, though, so might want a "persistent states" plugin or something if actors can be revived mid-battle.

The original skill does not include any hit, it just makes enemy to escape with low succession rate. It is just a skill with special effect...
Every skill/item checks for hit/miss on each applicable target. As I said, per-target effects (like Escape) only apply to targets that have been hit.

and as I already wrote I changed attack type and made enemy resistant to that hit type
You actually mentioned changing the damage type/element, not the hit type:
I tried to swich damage type from none to any from the list, so then I can change the element. Then I made the enemy resistant to that element, but it does not work.
Element affects damage; hit type affects hit/evasion checks. Hit types are:
  • Certain Hit = always hit (and ignore the target's state/debuff rates);
  • Physical Attack = checks user's Hit Rate and target's Evasion;
  • Magical Attack = checks target's Magic Evasion (and Magic Reflection).

hittype.png
By contrast, damage elements can be defined by you, on the Types tab in the database. 👋

The purpose of the skill is to make some of the enemies escape from battle with low succession rate, but in this game some enemies cannot be negotiated with.
OK, if it's for specific enemies then you'll either want:
  • Something like Andar suggested: a troop event with "Condition = Turn 0" that adds a state with a Seal Skill trait to everyone, and set the state to auto-remove on battle end.
  • ...or an appropriate plugin~
Spoiler: if you want to try the code I posted
Plaintext-to-plugin instructions:
  1. Copy + paste the code into a text editor (e.g. Notepad).
  2. File > Save As:
    • File Type: All Files
    • Filename: whatever.js
      (This works because .js files are plaintext.)
  3. Import that file as a plugin.
  4. Save your project to apply Plugin Manager changes.
  5. Test!
Sounds good! By default death removes all other states, though, so might want a "persistent states" plugin or something if actors can be revived mid-battle.


Every skill/item checks for hit/miss on each applicable target. As I said, per-target effects (like Escape) only apply to targets that have been hit.


You actually mentioned changing the damage type/element, not the hit type:

Element affects damage; hit type affects hit/evasion checks. Hit types are:
  • Certain Hit = always hit (and ignore the target's state/debuff rates);
  • Physical Attack = checks user's Hit Rate and target's Evasion;
  • Magical Attack = checks target's Magic Evasion (and Magic Reflection).

View attachment 322402

By contrast, damage elements can be defined by you, on the Types tab in the database. 👋


OK, if it's for specific enemies then you'll either want:
  • Something like Andar suggested: a troop event with "Condition = Turn 0" that adds a state with a Seal Skill trait to everyone, and set the state to auto-remove on battle end.
  • ...or an appropriate plugin~
Spoiler: if you want to try the code I posted
Plaintext-to-plugin instructions:
  1. Copy + paste the code into a text editor (e.g. Notepad).
  2. File > Save As:
    • File Type: All Files
    • Filename: whatever.js
      (This works because .js files are plaintext.)
  3. Import that file as a plugin.
  4. Save your project to apply Plugin Manager changes.
  5. Test!
Thank you for the answer. So this solution almost worked:

When the enemy appears there is a turn 0 event: "Change Skill : Actor, - Skill" then another event on same page "Change Skill : Actor, + Skill"

First it removes the original skill, then it adds new skill which has same name as the original, but this time it has 0% succession rate.

Then I added new event page for the same enemy and reversed that recipe for turn end...but in this case it reverses also everything after first attempt...still learning...

EDIT vol 238:
I´m being very frustrated but this seems to work after one test:
On troops there is only one event page with 0 event: "Change Skill : Actor, - Skill" and "Change Skill : Actor, + Skill" - as I wrote earlier to this, the original skill is now replaced with new skill which has same name as the original skill, but this new skill has 0% succession rate.

Then after battle there is parallel event on the map which reverses that recipe...seems to work.

FINAL EDIT:
Phew...it works flawlessly 🤣

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-make-enemy-resistant-to-special-effect.173071/