I have no idea if this will work so bear with me. It's pretty out there:
Porygon-Z @ Starf Berry
Adaptability
- Substitute / Endure
- Recycle
- Recover
- Tri-Attack
Keep subbing until your berry activates. The when its been activated you will receive a random +2 boost to either Atk, SpA, Def, SpD or Spe. Then you keep recycling which will keep activating the berry. When your sub breaks recover and sub again. Once your out of PP for recycle or subsitute the you sweep with tri-attack. The only problem is Ghost type Pokemon...
Alternatively you can endure, recover, recycle.
Does it sound like it could work?