The use of energy harvesting cooperative relays is a promising solution to battery-limited wireless networks. In this paper, we consider a cooperative system in which one source node transmits data to one destination with the assistance of an energy harvesting decode-And-forward (DF) relay node. Our objective is to minimize the long-Term average symbol error rate (SER) performance through a Markov decision process (MDP) framework. By doing so, we find the optimal stochastic power control at the relay that adapts the transmission power to the changes of energy harvesting, battery, channel, and decoding states. We derive a finite-integral expression for the exact average SER of the cooperative system. Further insights are gained by analyzing the asymptotic average SER and its lower and upper bounds at high signal-To-noise ratio (SNR), and the performance is eventually characterized by the occurrence probability of the relay's actions at the worst channel states in the MDP. We also show that the optimal cooperative policy at asymptotically high SNR follows a threshold-Type structure, i.e., the relay spends the harvested energy only when the signal is successfully decoded and the source is faced with the worst channel condition in its direct link. Using these observations to quantify the diversity gain and the energy harvesting gain, we reveal that full diversity is guaranteed if and only if the probability of harvesting zero energy quantum is zero, which can be achieved by reducing the energy quantum size or increasing the energy harvesting capability. Finally, we present several numerical examples to validate the analytical findings.