Creating a scoreboard/Ladder

Im trying to create like a sports scoreboard/Ladder but im struggling to work out how to get the order to appear correctly.
8 teams.
lets say team 6 has more points in the other. yea easy to set as number 1 for position/location, but now my brain stops working & i cant work out the easiest way to get number 2, 3, etc for the order of the ladder
by code or by event?
Either way really. Cant find a solution in either case
https://stackoverflow.com/questions/979256/sorting-an-array-of-javascript-objects

sorting algorithms are as old as the code that drives them.... along with conditionals, loops and console dumps

¯\_ツ_/¯
thanks. im not great at coding so doesnt help entirely with making it into a plugin with randomised variables lol, but ill give it a shot

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-scoreboard-ladder.88027/