Potential Dependence of Electrochemical Barriers from ab Initio Calculations