So I want the order of events to happen:
Player mines Tuff Block > They get mining fatigue 3 > They move to mining andesite > They get mining fatigue 2
But because of Minecraft's overriding system with effects, they keep mining fatigue 3 instead, here is the code for it:
on block damage:
if event-block is tuff:
execute console command "effect give %player% minecraft:mining_fatigue 999999 2 true"
else if event-block is andesite:
execute console command "effect give %player% minecraft:mining_fatigue 999999 1 true"
else if event-block is bedrock:
stop
else:
execute console command "effect clear %player% minecraft:mining_fatigue"