You can already do that, easily. The key is PROMOTION_ONLY_DEFENSIVE; this negative promotion disables the "melee" attack that all units would gain otherwise. The archery and artillery units have this promotion, and so can only bombard. But if you make a ranged unit that doesn't have that promotion, then it can do either. Note, though, that the default for those units (when you right-click an enemy) is to use the ranged attack instead of the melee, even if it's weaker, so you'd have to explicitly tell the unit to attack the normal way using the button on the left side of the screen.
I've done this in my mod; the endgame "Titan" units all have high Combat ratings, and most also have a bombardment attack. It works just fine to use both on the same unit.