Reduced power

Mark Xterra

Test Drive
All, my check engine light and the ABS and SLIP light come on while driving. when these come on I have reduced power. put it on a scanner and it said the pedal sensor was bad. this was just replaced before I bought it. I can pull over and kill it and restart it and they will go out and power will resume.Anyone have any ideals what may be causing the issue?