First time I tried this level, I get a success without changing a line of code.
Ok, I don’t have the bonus, but the main goal was ok.
The code was not running because of the error of missing findNearestEnemy().
What is funny, is that if I correct the code to run (replace by this.findNearest(this.findEnemies())), then the level fails (that is correct).
Another point : a comment state that "// A basic attack loop isn’t going to be enough to keep you alive."
In fact, a basic attack loop is enough to keep me alive, but not the peasant.