Javascript help press button make character animate

I'd like to make javascript so that when I press a button it performs an animation for my character.

I already know the code for javascript for button press. How for simplicity sake could I change my characters animation to the given dead animation when my button is pressed
Since the Damage contains multiple characters in multiple directions I added _directionFix = true. _characterIndex is the character block.
PHP:
// hero
$gamePlayer._characterName = "Damage1";  // fallen png
$gamePlayer._direction = 2;              // 2,4,6,8
$gamePlayer._directionFix = true;
$gamePlayer._characterIndex = 0;         // 0 - 7

// followers 0-2
var id = 0;
$gamePlayer._followers._data[id]._characterName = "Damage1";
$gamePlayer._followers._data[id]._direction = 8;
$gamePlayer._followers._data[id]._directionFix = true;
$gamePlayer._followers._data[id]._characterIndex = 0;

// events by id (1 for example)
var id = 1;
$gameMap._events[id]._characterName = "Damage1";
$gameMap._events[id]._direction = 4;
$gameMap._events[id]._directionFix = true;
$gameMap._events[id]._characterIndex = 0;

Original thread: https://forums.rpgmakerweb.com/threads/javascript-help-press-button-make-character-animate.77894/