There are five types of units:
Archery - Green
Cavalry - Purple
Fighter - Blue
Ballistics - Red
Hero - Dark red
(all colors can be seen in the background pictures of formations among other places)
There is no hero skill to boost hero type troops. all other troops have a hero skill that boosts their attack. Fighter hero skill will help all blue background troops; archer hero skill will boost all green background troops, etc... It should not matter if they are in melee or in their specialty.