Ugh, I have some issues with your macro.You're doubling up on several commands which I imagine are causing more work for your hardware than is necessary.
1) You're setting farclip (View Distance), environmentDetail, and both groundEffectDist and Density, but you are then overwriting all of those entries with the one-line "graphics" setting at the bottom. Also, extShadowQuality is not a valid CVar.
2) If you aren't going to stick with the one-line CVars, then groundEffectDist cannot be set lower than 40, and groundEffectDensity cannot be set lower than 16, and setting farclip to any value < 1000 does not actually lower it below its floor of 1000.
3) I'd recommend using the one-line graphics CVars since, for a standalone CVar like shadowMode, the standalone settings don't take everything into effect, and simply changing shadowMode by itself doesn't change the other two CVars associated with shadows (shadowSoft and shadowTextureSize) unless you use the one-line graphicsShadowQuality option. I believe the same goes for a CVar like waterDetail, as well, in Legion.
Connect With Us