Optimize Pokemon G and M scripts