"No Damage" Sound Effect

Hello,

I am looking for a way to automatically play a sound effect when an actor or enemy receives 0 damage. I've found the way to change the message that appears when receiving no damage (the Actor No Damage and Enemy No Damage parts of the Terms section in System), and I have found how to change the sound effects when missing an attack and evading an attack, but I cannot find a way to play a sound effect when 0 damage is taken.

Thank you
I think you'll need a plugin. This might do it (untested):
Spoiler: click to see plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Play a SE when anyone takes 0 HP damage.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/159969/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (alias => {
'use strict';

  /** SE to play when taking 0 HP damage. */
  const SE_0HP_DAMAGE = {
    name: "Crow",
    volume: 10,
    pitch: 150,
    pan: 0
  };

  // Play SE if appropriate.
  Window_BattleLog.prototype.displayHpDamage = function(target) {
    const res = target.result();
    if (res.hpAffected && res.hpDamage === 0)
      AudioManager.playSe(SE_0HP_DAMAGE);
    alias.apply(this, arguments);
  };

})(Window_BattleLog.prototype.displayHpDamage);
As-is, the SE is Crow.ogg at 10% volume, 150% pitch. You'll probably want to edit that. 👋
As-is, the SE is Crow.ogg at 10% volume, 150% pitch. You'll probably want to edit that.
Or use it for inspiration! The protagonist of the game now has a female, miniature crow familiar who taunts enemies whenever they miss a swing.
I think you'll need a plugin. This might do it (untested):
Spoiler: click to see plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Play a SE when anyone takes 0 HP damage.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/159969/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (alias => {
'use strict';

  /** SE to play when taking 0 HP damage. */
  const SE_0HP_DAMAGE = {
    name: "Crow",
    volume: 10,
    pitch: 150,
    pan: 0
  };

  // Play SE if appropriate.
  Window_BattleLog.prototype.displayHpDamage = function(target) {
    const res = target.result();
    if (res.hpAffected && res.hpDamage === 0)
      AudioManager.playSe(SE_0HP_DAMAGE);
    alias.apply(this, arguments);
  };

})(Window_BattleLog.prototype.displayHpDamage);
As-is, the SE is Crow.ogg at 10% volume, 150% pitch. You'll probably want to edit that. 👋
Thank you for the help! It works great 🙂


Or use it for inspiration! The protagonist of the game now has a female, miniature crow familiar who taunts enemies whenever they miss a swing.
That is a fun idea. Now I need to think of a project to use it in.

Original thread: https://forums.rpgmakerweb.com/threads/no-damage-sound-effect.159969/