When you use your phone while charging, the phone charges the battery at a slower rate than usual to allow enough power for the processor/screen. If anything, it greatly increases battery life because it is slowly charging and generating less heat inside the battery (which is annoying).