…it was perfectly legal for Bosnia to declare independence since it had a referendum (which the Serbs in Bosnia boycotted, that's their problem not the government's).

Bare in mind that the people's referendum makes something 'perfectly legal' when RS holds one. Even if it's against the constitution, like the referendum you were speaking about was. (BiH had three constituent nations, one boycotts they all boycott.)

By declaring independence without permission from the Bosnian government would be breaking international law, and Serbs can't do that and at the same time claim Kosovo shouldn't be independent because it broke international law as well.

Kosovo is in Serbia, not in the RS. Politically RS and Serbia are two separate states, Serbia can claim Mars for all RS cares since they don't share the same government.