Partnership LLC

How do you calculate adjusted basis of partner's interest in partnership LLC?

If you withdraw funds or pay partner's  from partnership LLC, is it considered decrease to interest?

Do you include proceeds from HELOC to finance business an addition to the partner's capital account?