How do I make the animation when attacking an enemy different from the one shown when attacking another enemy in the same battle?

I want an enemy, such as a slime, to have a different sound effect when attacked than, say, a bat. But I have only been able to find one way to change the sound effects and that is through the "Animations" tab in the Database. But this changes both the sound and animations for all enemies.
Is there a way to do this thing I want in a vanilla way?
This thread was moved from RPG Maker VXAce Tutorials to RPG Maker VXAce Support.
Is there a way to do this thing I want in a vanilla way?
Make different attacks for each enemy.

Add a new skill and assign that skill as the main attack for the enemy. Then set the skill to use a new animation and change the sound.
By following the instructions I was able to make the enemies have sound effects when they attack, which I appreciate. But I want them to have a sound effect when they are attacked or their health points decrease.
If you are fine with setting your attack animation to "None", you can then add something to your damage formula to play the animation for you.
Ruby:
SceneManager.scene.show_animation([b], your_attack_animation_id); your_damage_formula

Please, replace your_attack_animation_id and your_damage_formula with your stuff. Be aware that doing so in the basic attack skill will replace it for EVERY character and enemy.

This is just a basic example, if you want a specific animation for b, you can change your_attack_animation_id to ternary if/else.

Ruby:
b.enemy? && b.enemy_id == your_enemy_id ? animation_index_for_that_enemy : standard_animation_index

# It woud look like this (numbers are random)
b.enemy? && b.enemy_id == 4 ? 15 : -1

A complete formula example should be something like the one below.
Ruby:
SceneManager.scene.show_animation([b], b.enemy? && b.enemy_id == 4 ? 15 : -1); a.atk * 4 - b.def * 2

Since animations can have sounds in them, this can also be used to modify the attack sound.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-the-animation-when-attacking-an-enemy-different-from-the-one-shown-when-attacking-another-enemy-in-the-same-battle.175843/