Removing an NBT(Tag?) when another of a certain type is present

Is it possible to remove an NBT data when certain type is present?
Continue to help post