A person who offers prayer, gives zakat, fasts and performs Hajj may be accountable for failing to undertake a separate duty, but the merit and acceptance of those other acts are not thereby cancelled.
Likewise, a person who undertakes jihad but omits prayer, zakat, fasting or Hajj remains answerable for neglecting those duties; the omission does not of itself cancel the standing of the other act.
Each act has its own standing. Performing one prescribed act does not count as performing another, and omission of one is not a blanket rule nullifying every other act.