Sounds a lot like ignition coil issues, if it gets better after the car cools down. Also check that the high tension wires are okay.