Disable the "no effect" message on certain skills script?

In a two character RPG, I have a skill that is intended to restore the other actor's MP at the cost of the user's own MP.

The only way I could do this to ensure that the only actor is affected is not the one using the spell is to make the element of the MP recovery something that the user is immune to and set the move to target all allies. I created a dummy element for this.


However, that comes with a cost of the game displaying a message that there was no effect on the user.

So, I am requesting a script where I can disable that message for certain skills. I do not want all skills to be this way, just certain ones.

So something where I put in the note box something like <Disable No Effect MSG> or something where in the script I list off the skill IDs of what I do not want the "no effect" message to show.

I will use this script for multiple skills and most likely multiple projects. I would need something that would work with multiple games.


You all have been very helpful with scripts and I appreciate it even though I do not always show it.
Hey,

not directly a script, but what you could try for now is hiding the result through the damage formula if user and target are the same, assuming you have enough space:

a != b ? (Original Damage Formula) : 0.tap { b.result.used = false }

result.used
usually indicates whether the target was eligible to be hit and should hide the result from the log window if disabled. It won't fully cancel the hit already in progress, so you probably still have to make sure that the skill is uneffective to the user.
Put <no msg> in the note box for the skill to not show the use and fail message
Ruby:
class Window_BattleLog < Window_Selectable
  #--------------------------------------------------------------------------
  # * Display Skill/Item Use
  #--------------------------------------------------------------------------
  alias r2_display_no_message_on_skill  display_use_item
  def display_use_item(subject, item)
    return if item.is_a?(RPG::Skill) && item.note.include?("<no msg>")
    r2_display_no_message_on_skill(subject, item)
  end
  #--------------------------------------------------------------------------
  # * Display Failure
  #--------------------------------------------------------------------------
  alias r2_display_no_message_on_skill_failure  display_failure
  def display_failure(target, item)
    return if item.note.include?("<no msg>")
    r2_display_no_message_on_skill_failure(target, item)
  end
end
Nice but a bit problematic. You see, that might clash with other people's scripts like my KSkillMsg scriptlet depending on how they've ordered their scripts in the editor.

Original thread: https://forums.rpgmakerweb.com/threads/disable-the-no-effect-message-on-certain-skills-script.161621/