Staff of Magical Endurance (5e Equipment)
From D&D Wiki
Staff, legendary (major) (requires attunement by a creature with the Spellcasting or Pact Magic class feature)
This staff was infused with magical energy that allows it to handle the stress of spellcasting for whoever is attuned to it. This staff has 20 charges, and regains 1d10 charges at dawn.
After using the last charge, roll a d20. On a 1, the staff is rendered mundane and can only regain it's properties by expending a total of 20 spell slot levels into the staff within 1 hour. The staff regains 1d10 charges the next dawn.
Upon casting a spell of 1st level or higher while holding this staff, you may expend an amount of charges equal to twice the level of the spell to not consume the spell or pact slot.