Unit tests and fixes for combat script