runs good, then bad, then shuts down

that's like going to a doctor and saying i have a pain...and you have been given some good guesses.
i had the exact same problem twice. One time it was the ECU, maybe your replacement is bad. The other
time it was caused by a fuel tank vent being plugged.You will hear the pressure release when you take the
gas cap off....do this as soon as it stalls to check before the pressure equalizes.