RPG Combat system in javascript (for integration with hypertext/twine games)