Is there a function behaving the same as next_permutation does in C++?

So this is pretty confusing. And in Combinatorics.jl, nthperm([1, 2, 2], 2) will give [1, 2, 2]. So nthperm(nthperm([1, 2, 2], 2), 2) will stay at [1, 2, 2], which is not what I need.