When you use your phone while charging, the phone charges the battery at a slower rate than normal, to allow enough power for the processor/screen. If anything, it increases the battery life by a very small amount because it is charging slowly and generating less heat inside the battery (that causes it to degrade).