Gambler rogue

Level 3: Borrowed luck

You have two Luck Dice. Once per turn, when you are about to make a d20 test , you can spend 1 Luck Dice to give yourself advantage on any attack roll, ability check, or saving throw (no action required). After using a Luck Die, roll a d6. On a 1 or 2, you gain one Unlucky Mark.

You can have Unlucky Marks up to the number of Luck dice you may have. When you are about to make an attack roll, ability check, or saving throw, the DM may use one unlucky mark to impose disadvantage on a roll of their choice once per turn, or reduce your passive scores by 5 for one turn. The unlucky mark is then consumed

The number of luck dice you can have increases as you gain rogue levels: 3 at level 9, 4 at level 13, and 5 at level 17.

At the end of a short rest, you lose all Unlucky Marks and regain all expended Luck Dice.

Level 9:

You no longer gain an Unlucky Mark if the roll succeeds after using a Luck Die. Additionally, you can reroll a Luck Die once per turn, using the new result instead.

Level 13: Skew the Odds

You can manipulate fate to benefit yourself or others. When another creature within 30 feet you can see makes a d20 roll, you can expend a Luck Die as a reaction to roll make them reroll, using the new roll instead. If you use this feature on a creature other than an ally, you gain an Unlucky Mark.

If the roll is made by an ally and results a success, you gain temporary hit points equal to the number rolled.

Level 17:

You can spend two lucky points to immediately get a 20 on the die instead of rolling. This does not count as a critical hit for attack rolls.

You can use this feature once per long rest.