I will rebuild the whole commander function, the last tournament showed how weak it is.
(I am a turtle player and never see the AI ACU fighting)
Yes there is a function to check blocking terrain for weapon fire:
CheckBlockingTerrain()
https://github.com/Uveso/AI-Uveso/blob/master/hook/lua/platoon.lua#L3283
(It's not implemented to the commander function yet)
attempt to call method `bp.BuildCostEnergy' (a nil value)
This means, there is no entry inside the blueprint of this unit to calculate the CreateEnhancementEffects
Just changing the code inside unit.lua is not a good solution.
The function itself is ok, but the blueprint is missing the BuildCostEnergy for an enhancement.
So the blueprint must be fixed, not the function that reads the blueprint value.