Nice simple mod RateU
I might suggest adding a secondary sort, eg by referrals, then by uid (or maybe registration date) since it's not exactly known what would happen with two people with the same number of referrals. Not really an issue, but might help be a bit more consistent.
Maybe also stick an index on the referrals column when activating the plugin (or if you decide to sort by referrals then uid, make a composite index KEY(referrals,uid) ). Alternatively, you could cache the user with most referrals.
Hope that helps, and thanks for sharing!