Multiple characters is just a matter of using more variables. I can go figure that out if you want.
That bug of the HP wrapping around used to come in the Enemy's HP when it hit 0 as well. I just put a || HPE > 0) in the checking command at the end of the source.
The defence-thing is just used as an example. It could've been 'Magic', 'Item', 'Run' or anything else that fits in the game. I must admit that the defence itself still needs some fiddling before it is actually working.
The hit-message when defending doesn't do anything. It can be overcome by putting an extra if-statement in the end_player/enemy_turn flag that says not to print that when defending. Easy as eating pie.
I know of all these bugs, but was just too damn lazy to fix them

Anyway, if you can figure out the source, that means you know enough of the Logic programming to be able to take out the bugs yourself and manipulate the whole system to do what your game requires.
Tricke: That's why I made it. To test some theories and if it worked, to enable others to use the source. I'll make a detailed explanation of the whole system and put it in the tutorials-section of my site later. Anyways, feel free to use it.
-Kon-Tiki-