dshafik's php7-mysql-shim may be of use to you here.
Easiest way to implement, I feel, is through Composer. Simply require the package in, include the vendor's autoload.php, go!
Failing that, grab a copy of src/mysql.php (in the same Git repo), upload said copy to your files, include it before running any code that requires PHP5.4.
There are certain methods that cannot be replicated, even with a shim. However, you're less likely to run into these using game engines currently available on MWG.