little trick taught to me recently from some friends more versed in gearswap than I:
the priority function orders the gear swapping from the highest number first to the lowest number.
But, those numbers don't need to be sequencial.
If you want to keep highest HP possible between swaps, just assign the priority= number as the total HP on the piece.
If you want to keep highest MP possible between swaps, use the total MP on the piece as that number.
Even if the numbers go 200,151,70,60,24- it will function like 5,4,3,2,1.