Instead of using CDS spread to do risky discounting, I would like to use the bond yield curve. Can I directly use the discounting factors from the bond yield curve or do I need to figure out the probabilities of default like in a CDS curve and use them for the risky discounting?
Yes, you can consider a bond yield curve to be like any funding curve, and in particular get risky discount factors from it, and use them, for example, to discount cash flows.
Test that if you pv the bonds used to build the yield curve, you get back the input dirty price. Be careful how you interpolate. Don't mix different kinds of instruments (e.g. zero-recovery and highly collateralized, even if they have the same probability of default).