It sounds like you need to add transitions between the two states and set the Advance Conditions to somehting like "HasWeapon1", "HasWeapon2", then in code you set the conditions like this:
animation_tree.set("parameters/conditions/HasWeapon1", false)
animation_tree.set("parameters/conditions/HasWeapon2", true)