Eh its too complex to say here on this post.
What you will need variables set one to health and put it to 5. Everytime a monster hits you it goes down one everytime you kill a monster they drop a heart.Then you gain 1 health.Hit common events and make it so that if you hit A you do sword animation if you hit B you use spell information ETC.