My question is, the "it" in "The first time it melee attacks...", does it refers to the creature or the HA to know if it was its first melee attack.
"It" refers to the creature always. With ability or trait in Mage Wars the "it" refers to the attached creature.
The HA ability works like this:
When the creature with HA melee attacks it asks, "Is this the first time it (the creature) melee attacked this round?" If yes then it asks "Did the target attack and damage a friendly creature or holy conjuration this round?" If yes, it gets the bonus.
That series of questions follows the HA marker. If another HA is summoned in a round and it makes a melee attack, like say with a altar of the iron guard, then those questions get asked again and are specific to the new HA creatures previous actions in that round.
I hope that helps and not added more confusion.....