Before changing out parts willy-nilly, check to see whether it is the ignition or fuel system that is at fault.
So often people jump to the wrong conclusions without knowing the facts. A potentially expensive way to sort a problem.
Try checking for spark as it fails or try operating the choke when it gives out. Check to see if fuel drains from the carburettor for a full minute or more at full flow.
It could be the ignition coil or it could be fuel starvation. Find out first is my advice.