else SetMonsterCourageAndMood(monster, 0, MONSTER_COURAGE_ALWAYS_FIGHT, MONSTER_MOOD_HOSTILE)
In your script, there is a mention of the hero "Nicholas," and for him, you are changing the "mood" and "decision" of creatures. If a monster belongs to the Haven faction, its mood and decision are changed. In the next line, you are already stating that they should be aggressive towards this hero and always fight him. Perhaps I am mistaken; I haven't created such specializations.
Some points in your script also seem confusing.