Using vagcom while car is running, check the engine section and go to measuring blocks I cannot remember which block you read but if you cycle them you will notice that you will eventually get to one that will show the mass airflow reading, this will confirm that your MAF is working so you can rule that out.
Your first error code is related to the battery being disconnected at some point, your second error code is your MAF, i would recommend that you buy some electronic contact cleaner and use that to clean up your MAF, or even see if you have a friend that has the same engine that you could maybe borrow their MAF to test on your car.
Do you by any chance have an induction kit? If its a K&N that has the cone coated in cleaning oil these are known for killing MAFs.
I would hazzard a guess that you have a boost leak, check every single boost pipe, vac hose especially the turbo inlet pipe from the MAF going down to the turbo, check all the little vac lines under the inlet manifold and the pancake pipe connecting to your side mount intercooler.
Failing that worse case it could be the turbo