Ending a staircase after a maximum number of trials

Hi! I am trying to interleave two simple staircases that each end once they have exceeded a set number of reversals; however, this requires I set nReps to 0 because the staircase only terminates when nReps AND nReversals are both exceeded.

The trouble is that I want to include a maximum number of trials upon which a staircase will terminate, regardless of if it has reached the target number of reversals or not - and if the other staircase has not reached its maximum trials or reversals, it will continue to run trials.

OS: MacOS
PsychoPy version: 2023.1.2

What did you try to make it work?: I have tried using break, continue, and continueRoutine = False in a number of ways and defined a variable to track the number of trials completed for each staircase; however, these have since either led to crashes or one of the two staircases ending incomplete.

Anything helps! Thank you so much.