You have complete flexibility in how you set up your blend tree. I’ve attached an image of an example that uses a state machine for the locomotion, blending in an upper body subtree on top of that.
The slot nodes act like pass-thru nodes normally, but they can be targeted by code or active animation montages, and will then play the specified animation instead of whatever was wired into their left side. This is just one approach, but in the attached graph, melee attacks are upper body only, blended in on top of the locomotion driving the lower body.
Check out the blend nodes documentation for more information on layered blends, additive, etc…