This is the final version I submitted to the 2018 Entellect tower defense game bot challenge where I placed #11 out of 98. Most of the logic is in state.js.