Introducing the Cover rules from 5e PHB page 196. For a rough summary, shooting "through" another creature (ally or enemy) provides your target with +2 to its AC, if the creature is covering at least 1/2 of the target. So, as an example:
X -> YZ
If X shoots at Y, X rolls their attack as normal.
If X shoots at Z, Z gets a bonus of +2 to its AC
Implementing this solves the problems created by granting Advantage/Disadvantage to attacking from/against a target above/below you. For starters, it's less of a mechanical bonus or penalty to the Attack roll, which makes the impact on combat of even small changes in height less pronounced. Solving that problem can trickle down to realigning enemy AC/HP values with what they should be in the monster's stat block, which solves a whole host of other issues.
However, it still provides a reward/penalty for use of the 3d terrain. Using the previous example, if X is 10 meters up in the air, and shoots at Z, Z would likely not receive any bonus to its AC because X is high enough so that Y isn't blocking at least 1/2 of Z. Moreover, X will have the reward of being able to Move to the edge of the cliff/roof/etc., shoot, then move backwards to possibly gain Cover from whatever is providing their height advantage.
+1
Please implement it like this. This is just better, than the current solution.
The current granting of advantage for ranged attackers devalues other options to gain advantage, because it's so extremly simple to gain. Easy ranged advantage indirectly devalues all other options to gain advantage. This is what makes it seem, on the surface, that shoving, grappling and other combat manoeuvres need a decrease in cost from full action to bonus action.
The current settup also strengthens ranged attacks, an already strong combat option (If have seen it argued that ranged attacks are strictly superior to close quarters combat in D&D). This tilts combat more extremely in the direction of ranged attacks. Well set up ambushes gain an obscene boost.