1. There is, atleast used to be, this AllowDammage command. Dunno if it works anymore ...
trigger so that landing players activates it. Make sure trigger ends where you want MG to start taking hits
Activated by West present (or who ever attackin side is )
Condition: this
On Activation: MG2 AllowDammage false
On Deactivation:MG2 AllowDammage true
I guess you get an idea ...
2. Try Condition : MG2 distance player < 500 ( or what ever distance)
On Activation: MG2 SetCombatMode "red"; MG2 CommandTarget player
Dunno if this helps at all, just trying to help