Is there a way to macro two abilities to the same macro so they are used under different scenarios? For one example on a death knight; have the 1 key set so if your target is in melee range you use Marrowrend, if they target is out of melee range you use Death’s Caress. Or another less likely; use Marrowrend if you have less than 5 bone shield and use Heart Strike if you do.
Only ones I know to do that are harm/heal types.
Harm mob cast x, heal thing cast y.
Otherwise it approaches automatic gameplay blizz doesn’t like.
I could be wrong though.
You could have a modifier macro for melee/ranged so it is 1 = melee shift 1 = ranged.
For the other one you are asking no, you aren’t going to be able to automate your gameplay in that way, just use a weak aura.
You can only macro multiple abilities that do not share the same GCD or an ability that is on a GCD and an ability that isn’t on any GCD. Yes there are multiple GCD’s.
My opinion is that you are totally better off making your two macros and using your own eyes and timing to execute. Monks have loads of what-if dependencies (dont pop earthstorm unless fists is up, etc) that “could” be macro’d with an “if” statement, but macro misses some situations - usually the ones that kill me.
Neither range nor resource intelligence is available through the macro system - those are decisions Blizzard wants you to make on your own.
https://wow.gamepedia.com/Macro_conditionals
In general, macros that function differently based on scenario are possible, but not all scenarios.