Removing PROMOTION_ONLY_DEFENSIVE will allow the unit to make both mellee and ranged attacks, BUT it will always use the ranged one by default, so the AI will never mellee with it. The only time the unit will mellee attack is if the player clicks "move" on the unit action panel before clicking on the enemy.
Another option would be to give your unit the Zulu Impi promotion, so it always does both ranged and mellee with every attack.
Removing PROMOTION_ONLY_DEFENSIVE will allow the unit to make both mellee and ranged attacks, BUT it will always use the ranged one by default, so the AI will never mellee with it. The only time the unit will mellee attack is if the player clicks "move" on the unit action panel before clicking on the enemy.
Another option would be to give your unit the Zulu Impi promotion, so it always does both ranged and mellee with every attack.
Sadly, this does not seem to work. I tried this very thing literally just two days ago with doing some changes to naval units, and while removing the PROMOTION_ONLY_DEFENSIVE does make an "attack" option come up over the ranged attack option in the unit action menu, but clicking this option does not give you any possible targets, even when adjacent to the target unit, and also moving to the occupied target is not an option.Removing PROMOTION_ONLY_DEFENSIVE will allow the unit to make both mellee and ranged attacks, BUT it will always use the ranged one by default, so the AI will never mellee with it. The only time the unit will mellee attack is if the player clicks "move" on the unit action panel before clicking on the enemy.
<GameData>
<Units>
<Delete Type="UNIT_TRIREME"/>
<Row>
<Class>UNITCLASS_TRIREME</Class>
<Type>UNIT_TRIREME</Type>
<PrereqTech>TECH_SAILING</PrereqTech>
<Combat>10</Combat>
<RangedCombat>8</RangedCombat>
<Cost>45</Cost>
<Moves>4</Moves>
<Range>1</Range>
<CombatClass>UNITCOMBAT_NAVALRANGED</CombatClass>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_ASSAULT_SEA</DefaultUnitAI>
<Description>TXT_KEY_UNIT_TRIREME</Description>
<Civilopedia>TXT_KEY_CIV5_ANTIQUITY_TRIREME_TEXT</Civilopedia>
<Strategy>TXT_KEY_UNIT_TRIREME_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_HELP_TRIREME</Help>
<MilitarySupport>true</MilitarySupport>
<MilitaryProduction>true</MilitaryProduction>
<Pillage>true</Pillage>
<Mechanized>true</Mechanized>
<ObsoleteTech>TECH_KEEL</ObsoleteTech>
<AdvancedStartCost>30</AdvancedStartCost>
<MinAreaSize>10</MinAreaSize>
<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
<UnitArtInfo>ART_DEF_UNIT_TRIREME</UnitArtInfo>
<UnitFlagIconOffset>24</UnitFlagIconOffset>
<IconAtlas>UNIT_ATLAS_1</IconAtlas>
<PortraitIndex>24</PortraitIndex>
<MoveRate>WOODEN_BOAT</MoveRate>
</Row>
</Units>
<Unit_AITypes>
<Delete UnitType="UNIT_TRIREME"/>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<UnitAIType>UNITAI_ASSAULT_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<UnitAIType>UNITAI_EXPLORE_SEA</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_ClassUpgrades>
<Delete UnitType="UNIT_TRIREME"/>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<UnitClassType>UNITCLASS_GALLEASS</UnitClassType>
</Row>
</Unit_ClassUpgrades>
<Unit_FreePromotions>
<Delete UnitType="UNIT_TRIREME"/>
<Row>
<UnitType>UNIT_TRIREME</UnitType>
<PromotionType>PROMOTION_OCEAN_IMPASSABLE</PromotionType>
</Row>
</Unit_FreePromotions>
</GameData>
<Units>
<Row>
<Type>UNIT_FLOWER_CLASS_CORVETTE888</Type>
<Description>TXT_KEY_UNIT_FLOWER_CLASS_CORVETTE888</Description>
<CombatClass>UNITCOMBAT_NAVALRANGED</CombatClass>
<Domain>DOMAIN_SEA</Domain>
<Class>UNITCLASS_FLOWER888</Class>
<Cost>350</Cost>
<AdvancedStartCost>54</AdvancedStartCost>
<Combat>50</Combat>
<RangedCombat>60</RangedCombat>
<Range>2</Range>
<IgnoreBuildingDefense>true</IgnoreBuildingDefense>
<Moves>6</Moves>
<AirInterceptRange>2</AirInterceptRange>
<Strategy>TXT_KEY_UNIT_FLOWER_CLASS_CORVETTE888_STRATEGY</Strategy>
<Help>TXT_KEY_UNIT_FLOWER_CLASS_CORVETTE888_HELP</Help>
<Civilopedia>TXT_KEY_UNIT_FLOWER_CLASS_CORVETTE888_PEDIA</Civilopedia>
<PrereqTech>TECH_BALLISTICS</PrereqTech>
<Pillage>true</Pillage>
<MoveRate>BOAT</MoveRate>
<Mechanized>true</Mechanized>
<UnitArtInfo>ART_DEF_UNIT_FLOWER_CLASS_CORVETTE888</UnitArtInfo>
<IconAtlas>ATLAS_ICON_UNIT_FLOWER_CLASS_CORVETTE888</IconAtlas>
<PortraitIndex>0</PortraitIndex>
<UnitFlagAtlas>UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>67</UnitFlagIconOffset>
<RangedCombatLimit>100</RangedCombatLimit>
<MinAreaSize>10</MinAreaSize>
<MilitaryProduction>true</MilitaryProduction>
<XPValueAttack>4</XPValueAttack>
<XPValueDefense>4</XPValueDefense>
<MilitarySupport>true</MilitarySupport>
<DefaultUnitAI>UNITAI_ASSAULT_SEA</DefaultUnitAI>
</Row>
</Units>
<Unit_AITypes>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<UnitAIType>UNITAI_ASSAULT_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
</Row>
</Unit_AITypes>
<Unit_Flavors>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>18</Flavor>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<FlavorType>FLAVOR_NAVAL_RECON</FlavorType>
<Flavor>5</Flavor>
</Row>
</Unit_Flavors>
<Unit_FreePromotions>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_ANTI_SUBMARINE_I</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_CAN_MOVE_AFTER_ATTACKING</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_SEE_INVISIBLE_SUBMARINE</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_STRONGER_VS_DAMAGED</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_STEAM_POWERED</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_TARGETING_1</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_INTERCEPTION_II</PromotionType>
</Row>
<Row>
<UnitType>UNIT_FLOWER_CLASS_CORVETTE888</UnitType>
<PromotionType>PROMOTION_CARGO_II</PromotionType>
</Row>
</Unit_FreePromotions>
<GameData>
<Unit_FreePromotions>
<Delete UnitType="UNIT_ARCHER" PromotionType="PROMOTION_ONLY_DEFENSIVE"/>
</Unit_FreePromotions>
</GameData>
<GameData>
<Unit_FreePromotions>
<Delete PromotionType="PROMOTION_ONLY_DEFENSIVE"/>
</Unit_FreePromotions>
</GameData>