Mobile operators are deploying energy-harvesting heterogeneous networks due to their foreseen advantages such as self-sustainable capability and reduced operating expenditure, which cannot be offered by conventional grid powered communications. However, the used energy storage is subject to irreversible aging mechanisms, requiring intelligent management that considers both the energy cost and battery life cycle. In this paper, we propose a cognitive energy management strategy for small cell base stations powered by local renewable energy, a battery, and the smart grid to simultaneously minimize electricity expenditures of the mobile operators and enhance the life span of the storage device. Non-linear battery models and aging processes are considered to formulate the energy cost optimization problem. Simulation results in different configurations show that a degradation-aware policy significantly improves the battery lifetime, while achieving considerable cost savings.