How to make the health system work

I am making a health system for a game I am making for school, but I cannot figure out how to make the UI sprite for the health change clips, so I tried editing the script, but now it is giving me an error, does anyone know how to:

  1. Work with the fire script
  2. change clips of an animated sprite
    here is the project editor link: PlayCanvas | HTML5 Game Engine
    and the script that is giving me an error link: PlayCanvas | HTML5 Game Engine