This is an amazingly complete answer, thank you so much!
I was actually trying to implement this as an intermediate step of a more complex model that involved successively taking the maximum of a series of random variables, so (from what I understood from your answer) this solution doesn’t quite work out for me.
I have opened a new topic with more context, if you find the time to look at that I would really appreciate it!