if the witness ends up being not favorable to your case, then you can have the judge declare him to be a "hostile" witness, therefore allowing you to ask leading questions.
This is not really accurate.
A typically case where a witness would be called a "hostile witness" for leading question purposes would be a case where the plaintiff calls the defendant or someone closely affiliated with the defendant as a witness.
The nature of the relationship and not the actual content of the testimony determines if someone is a hostile witness. Neutral third parties are not "hostile witnesses" for this purpose even if their testimony if not favorable to your case.
The relevant Colorado Rule of Evidence which tracks the federal rule which is the model for the vast majority of states describes the rule as follows:
RULE 611 Mode and Order of Interrogation and Presentation
(a) Control by court. The court shall exercise reasonable control over the mode and order of interrogating witnesses and presenting evidence so as to (1) make the interrogation and presentation effective for the ascertainment of the truth, (2) avoid needless consumption of time, and (3) protect witnesses from harassment or undue embarrassment.
(b) Scope of cross-examination. Cross-examination should be limited to the subject matter of the direct examination and matters affecting the credibility of the witness. The court may, in the exercise of discretion, permit inquiry into additional matters as if on direct examination.
(c) Leading questions. Leading questions should not be used on the direct examination of a witness except as may be necessary to develop his testimony. Leading questions should be permitted on cross-examination. When a party calls a hostile witness, an adverse party, or a witness identified with an adverse party, interrogation may be by leading questions.
A typical, run of the mill, example of a hostile witness who is not necessarily an adverse party or strictly identified with an adverse party would be the uncle of a criminal defendant, called by the prosecution, who is appearing to testify by subpoena because he was unwilling to testify voluntarily. See, e.g., Vigil v. People, 415 P.2d 863, 864 (Colo. 1966).
Before the Federal Rules of Evidence were adopted, a variety of precise relationships to a defendant that would qualify you as a hostile witness were set out by rule or statute, and the Federal Rules of Evidence liberalized the practice of examining hostile witnesses with leading questions by making it a general standard, rather than a more detailed rule.