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.
Isn't this just changing the name? The latter mechanic, shooting over Y to shoot Z already exists, in the Advantage of high ground, exactly as per your example. I'm not sure how the game calculates shooting at z through y, but if it's applying disadvantage now, that would be the same as the AC bonus Z gets, or at least similar?