Well, nobody is perfect, or as "bad" as it is said ... the problem that the diagnosis with the engine started without connecting the MAF to the butterfly entrance has already been able to falsify the reading of codes, it would have to be done again to do it. Nor is it surprising that the engine is going wrong, if the MAF is not connected ... As for the codes it is giving, it is only my opinion in what I would check:
511: Injection relays (LO 2)
118: Check the temperature sensor (it is not worth bridge)
121: TPS Measure its resistance at different points, with the engine on, measure voltage between butt (moving this)
113: air temperature Connected the flow, in any case, check this resistance.
335: EGR, I think it may have failed as the MAF is not connected. It would have to review Tomas.
Needless to, you have to check the spark plug cables, not just resistance, also isolation. Measure the DIS his resistances, the crankshaft collector his resistance (the crown is in the engine steering wheel, it is not necessary to review it), also pay attention to the tree collector cams and measure it resistance.
Although it may seem nonsense, it costs nothing to measure the gasoline pressure on the ramp, it costs nothing, you have to make sure the regulator works.
I put here a link that can serve as use to compare values and measure continuity of the wiring.
www.autoxuga.net/cursos/esquemas/esquemas4.htm
This is the work that sometimes brings electronic failures, it can be nonsense, but sometimes it is not so easy to know what it is. Greetings to all !!