How to swap between layered blend and normal animation?

I have this layered animation where when im moving and use an attack the upped body will use the attack animation and the bottom will use the running animation.
My problem is that when im standing still and use the attack, the layered animation is used and only the upped half uses the attack animation while the bottom half uses the idle anim. The attack anim moves the legs originally, but with the layered one in place it doesn’t do that.
My question is how can i make it so while im moving and attack it uses the layered anim, and while im standing it uses the original one, and if i start attacking while standing, it uses the original but if i start moving, it only swaps and bottom half with instead of starting over the whole animation including the attack.