Attempting to commit an offence is also illegal.
Don’t think you are only liable if the offence is committed in full!
Under Sections 159G and 159J of the Crimes Ordinance (Cap. 200), a person is guilty of attempting to commit an offence if the person who, intending to commit the offence, does an act that is more than merely preparatory to the commission of the offence. The person may be found guilty even though the facts are such that the commission of the offence is impossible. Generally speaking, a person guilty of attempting to commit an office is liable on conviction to any penalty to which he would have been liable on conviction of that offence.