Pathfinder is full of options... sorta.
First, I don't believe the fireball trick works. Fireball does not target "one or more creatures or objects" and therefore isn't viable for being turned into a potion.
Still, there are some things that sort-of work:
- Possession. If you can gain control of their body in some fashion, and then take actions drinking attack potions. THe simplest form of this is likely Beguiling Gift. Not really what you're looking for, I suspect.
- Share Pain, Forced: You take half the damage, they take half the damage. Doesn't work if you're immune to the damage in question, but says nothing about whatever else you might have set up to, say, rapidly heal from same or get bennies for being hit repeatedly by a specific damage type.
- Body Capacitance: cast the spell, then take a bunch of lightning damage, then share it with your foes. Sadly, only works on whatever the largest single instance of lightning damage was - you can't powerguzzle shocking grasp to build up to a really big hit.
- Use Contagion to give yourself a disease, which you can then share through the standard means
- Draconic Reservoir will absorb the damage you take of (pick element) and let you use that to infuse your blows
- If your GM allows you to add metamagic to potions in any way, then the Bouncing Spell metamagic might work, as long as you could consistently resist and/or save against the spells in question.
- Arguably, a Rod of Absorption or Staff of the Magi coudl be used to absorb the spell attack from the potion, letting you unleash the result on your foes with a later action.
I'm certain there are more, at or about that level of "well, sorta". Pathfinder has a lot of options. I suspect that there's nothing out there that's exactly what you're looking for, however.
I spent a fair bit of time looking for spells that would initially attack you (I got up through the Fs, searching on a comprehensive database for PFS-legal spells up through 3rd level), It appears that that's not how they do things - anything that can be retargeted in an ongoing sense is either a "grant the target the ability to do X" (like Call Lightning) or a persistent effect that can then be controlled after it is conjured. None of them were a specific target where the target could be reassigned. Such a thing is not technically impossible, but you'd likely have to design the spell yourself, or find it as a third party/homebrew.
You might be better off focusing on spells that grant the target an attack (like, say, call lightning) rather than ones that are trying to attack you. Also, if you're going to get serious about this stuff, you might want to consider Amplify Elixir.