It's not anything hard. -SoulBurn gave you the idea already. Melee maps use the trigger "Create Starting units for All players". Since the creation of the units cannot be controlled in every aspect (hardcoded action), your only bet is to replace those created units with the custom units of yours.
-
Trigger
-
Events
-

Map Initialization
-
Conditions
-
Actions
-

Custom script: set bj_wantDestroyGroup = true
-

Unit Group - Pick every unit in (Units in (Playable Map Area) matching (Race of (Matching unit) Equal to Orc) and do (Actions)
-


Loop - Actions
-



If (All conditions are true) then do (Actions) else do (Actions)
-




If - Conditions
-





((Picked unit) is a Peon-type unit) Equal to True
-




Then - Actions
-





Unit - Replace (Picked unit) with a Beast using the New unit's relative health and mana
-




Else - Actions
-





If (All conditions are true) then do (Actions) else do (Actions)
-






If - Conditions
-







((Picked unit) is a townhall-type unit) Equal to True
-






Then - Actions
-







Unit - Replace (Picked unit) with a Beast Den using the New unit's relative health and mana
Like I mentioned above, this trigger will replace every worker unit with a "Beast (
my custom unit)" and every town hall with a "Beast Den".
A "worker" unit is defined by the object editor, in the field Unit - Unit classification (go to the unit of yours and scroll to this field).
The trigger above contains a "Custom script" action; it's because you will need to remove the leak, created by the Unit Group, you are about to pick (Units classified as workers). Unit Groups, Points, Sounds, Special Effects, Lightnings, Rects, Timers, Player Groups and Strings leak. Strings leak only once (luckily), but there's not much you can do about them.
For more info:
•
https://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/