Welcome to the forum! This is a family-friendly place where coders can share bugs, ask for help on any CodeCombat level (don’t forget to post your code correctly), or just hang out with other coders. But before you proceed, please check out our guidelines: this topic.
Have a great time! (I beat @enPointe77 to it again :D)
Your indentation error on line 4 breaks your whole code.
And if hero.isReady("cleave"):
should be if enemy and hero.isReady("cleave")
, since otherwise, you will cleave even if there aren’t any enemies.