I am having trouble animating a weapon because I want to animate the magazine of the weapon, but I also want to animate the weapon itself too, but since the magazine is a child of the weapon bone it will always follow its location and it will look weird when I try to animate both of them, so is there a fix to this? (I am trying to avoid unparenting the objects if possible)
You don't. The whole point of parenting is that the children move with the parent. But, if you don't connect the child bone to the parent bone then you can move the child after you've moved the parent:
If you really want the child to only sometimes be a child, instead of parenting it, give it a Child Of constraint. You can then set the influence to 0 when you want the child to be completely independent of the parent and 1 when you want it to move with the parent:
You add a Bone constraint by selecting the bone in Pose mode and going to the Bone Constraint Properties tab of the Properties editor.