Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
Since Zarel said it would be fine to PR an implementation of this, with the caveat it'll need some work when preact happens (which can be done now - code comments!) I'm going to work on this.