@minamixdrops, the code was originally developed by @StellaTerra, who explained the formula as follows:
The script became so popular that StellaTerra created a thread for us to address questions specifically about it: Official leechDetector script thread. @bladepoint’s explanation is correct.