Since the bioactive surface needs hydrophilic coating; and the high corrosion resistance needs a hydrophobic one, it is a challenge to design a bioactive film that exhibits corrosion protection. In this article, Hexa-Methylene Diamine Tetra-Methylene Phosphonic Acid (HMDTMPA) film was deposited on Mg substrate at different heat treatment conditions. The heat-treated films at 150°C showed remarkable anticorrosion performance about five times the non-heated film. In addition, bioactivity character such as live cells attraction was noticed due to the increase of P-O groups that compensated the decrease of O-H groups in the film structure. Through the post-heat treatment, we were able to provide a new insight towards understanding how particular functional groups (OH) can modify the organic coating quality. The master key here is the formation of a stable film of chloroapatite that plays dual functions to inhibit the corrosive ions penetration and improve the bioactivity to attract the living-cell.