Welp, that's simpler than I expected. Thanks for the example!
EDIT: Tested it with my game and it works well, except now I need to figure out how to make it so that enemies closer to camera (lower than player on screen) scale upwards instead of shrink like objects higher than player.
EDITEDIT: Disregard that, got it working. I just checked if the object's Y-position is higher or lower to player's and then added or subtracted the calculation accordingly. And next time I'll consider twice before editing posts.