We have performed a set of first-principles simulations to consider the possible phase transitions in molecular crystals of HCN under high pressure. Our calculations reveal several transition paths from the orthorhombic phase to tetragonal and then to triclinic phases. The transitions from the orthorhombic to the tetragonal phases are of the second order, whereas those from the tetragonal to the triclinic phases turn out to be of the first-order type and characterized by an abrupt decrease in volume. Our calculations show that, by adjustment of the temperature and pressure of the HCN molecular crystal, novel layered and polymeric crystals with insulating, semiconducting or metallic properties can be found. Based on our simulation results, two different crystal formation mechanisms are deduced. The stabilities of the predicted structures at ambient pressure are further assessed by performing phonon or MD simulations. In addition, the electron transport properties of the predicted polymers are obtained using the non-equilibrium Greens function technique combined with density functional theory. The results show that the polymers have metallic-like IV characteristics.